Compare commits
10 commits
87d01580ee
...
ef8d036ecd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef8d036ecd | ||
|
|
41a38130ae | ||
|
|
8fb735b94f | ||
|
|
1d29fd8231 | ||
|
|
a9ca845b62 | ||
|
|
a888ea94e5 | ||
|
|
9ef89b76d6 | ||
|
|
448762ff63 | ||
|
|
1c66294a7a | ||
|
|
e101cad354 |
16
Gemfile
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem 'foreman'
|
||||
gem 'sinatra'
|
||||
gem 'puma'
|
||||
gem "sinatra-activerecord"
|
||||
gem "sqlite3"
|
||||
gem "rake"
|
||||
|
||||
gem "rackup", "~> 2.1"
|
||||
|
||||
gem "sinatra-contrib", "~> 4.0"
|
||||
|
||||
gem "timecop", "~> 0.9.8"
|
||||
110
Gemfile.lock
|
|
@ -1,110 +0,0 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activemodel (8.0.1)
|
||||
activesupport (= 8.0.1)
|
||||
activerecord (8.0.1)
|
||||
activemodel (= 8.0.1)
|
||||
activesupport (= 8.0.1)
|
||||
timeout (>= 0.4.0)
|
||||
activesupport (8.0.1)
|
||||
base64
|
||||
benchmark (>= 0.3)
|
||||
bigdecimal
|
||||
concurrent-ruby (~> 1.0, >= 1.3.1)
|
||||
connection_pool (>= 2.2.5)
|
||||
drb
|
||||
i18n (>= 1.6, < 2)
|
||||
logger (>= 1.4.2)
|
||||
minitest (>= 5.1)
|
||||
securerandom (>= 0.3)
|
||||
tzinfo (~> 2.0, >= 2.0.5)
|
||||
uri (>= 0.13.1)
|
||||
base64 (0.2.0)
|
||||
benchmark (0.4.0)
|
||||
bigdecimal (3.1.9)
|
||||
concurrent-ruby (1.3.5)
|
||||
connection_pool (2.5.0)
|
||||
drb (2.2.1)
|
||||
foreman (0.88.1)
|
||||
i18n (1.14.7)
|
||||
concurrent-ruby (~> 1.0)
|
||||
logger (1.6.6)
|
||||
minitest (5.25.4)
|
||||
multi_json (1.15.0)
|
||||
mustermann (3.0.3)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
nio4r (2.7.4)
|
||||
puma (6.6.0)
|
||||
nio4r (~> 2.0)
|
||||
rack (3.1.11)
|
||||
rack-protection (4.1.1)
|
||||
base64 (>= 0.1.0)
|
||||
logger (>= 1.6.0)
|
||||
rack (>= 3.0.0, < 4)
|
||||
rack-session (2.1.0)
|
||||
base64 (>= 0.1.0)
|
||||
rack (>= 3.0.0)
|
||||
rackup (2.2.1)
|
||||
rack (>= 3)
|
||||
rake (13.2.1)
|
||||
ruby2_keywords (0.0.5)
|
||||
securerandom (0.4.1)
|
||||
sinatra (4.1.1)
|
||||
logger (>= 1.6.0)
|
||||
mustermann (~> 3.0)
|
||||
rack (>= 3.0.0, < 4)
|
||||
rack-protection (= 4.1.1)
|
||||
rack-session (>= 2.0.0, < 3)
|
||||
tilt (~> 2.0)
|
||||
sinatra-activerecord (2.0.28)
|
||||
activerecord (>= 4.1)
|
||||
sinatra (>= 1.0)
|
||||
sinatra-contrib (4.1.1)
|
||||
multi_json (>= 0.0.2)
|
||||
mustermann (~> 3.0)
|
||||
rack-protection (= 4.1.1)
|
||||
sinatra (= 4.1.1)
|
||||
tilt (~> 2.0)
|
||||
sqlite3 (2.6.0-aarch64-linux-gnu)
|
||||
sqlite3 (2.6.0-aarch64-linux-musl)
|
||||
sqlite3 (2.6.0-arm-linux-gnu)
|
||||
sqlite3 (2.6.0-arm-linux-musl)
|
||||
sqlite3 (2.6.0-arm64-darwin)
|
||||
sqlite3 (2.6.0-x86-linux-gnu)
|
||||
sqlite3 (2.6.0-x86-linux-musl)
|
||||
sqlite3 (2.6.0-x86_64-darwin)
|
||||
sqlite3 (2.6.0-x86_64-linux-gnu)
|
||||
sqlite3 (2.6.0-x86_64-linux-musl)
|
||||
tilt (2.6.0)
|
||||
timecop (0.9.10)
|
||||
timeout (0.4.3)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
uri (1.0.3)
|
||||
|
||||
PLATFORMS
|
||||
aarch64-linux-gnu
|
||||
aarch64-linux-musl
|
||||
arm-linux-gnu
|
||||
arm-linux-musl
|
||||
arm64-darwin
|
||||
x86-linux-gnu
|
||||
x86-linux-musl
|
||||
x86_64-darwin
|
||||
x86_64-linux-gnu
|
||||
x86_64-linux-musl
|
||||
|
||||
DEPENDENCIES
|
||||
foreman
|
||||
puma
|
||||
rackup (~> 2.1)
|
||||
rake
|
||||
sinatra
|
||||
sinatra-activerecord
|
||||
sinatra-contrib (~> 4.0)
|
||||
sqlite3
|
||||
timecop (~> 0.9.8)
|
||||
|
||||
BUNDLED WITH
|
||||
2.5.19
|
||||
1
Procfile
|
|
@ -1 +0,0 @@
|
|||
web: ruby mood_app.rb
|
||||
8
Rakefile
|
|
@ -1,8 +0,0 @@
|
|||
# Rakefile
|
||||
require "sinatra/activerecord/rake"
|
||||
|
||||
namespace :db do
|
||||
task :load_config do
|
||||
require "./mood_app"
|
||||
end
|
||||
end
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
require './mood_app'
|
||||
run MoodApp
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
class CreateMoods < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :moods do |t|
|
||||
t.string :mode, null: false
|
||||
t.datetime :recorded_at, precision: nil, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
class CreateEvents < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :events do |t|
|
||||
t.string :title
|
||||
t.text :description
|
||||
t.datetime :taken_place_on, precision: nil, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
24
db/schema.rb
|
|
@ -1,24 +0,0 @@
|
|||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
||||
# be faster and is potentially less error prone than running all of your
|
||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
||||
# migrations use external dependencies or application code.
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_11_01_211840) do
|
||||
create_table "events", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.datetime "taken_place_on", precision: nil, null: false
|
||||
end
|
||||
|
||||
create_table "moods", force: :cascade do |t|
|
||||
t.string "mode", null: false
|
||||
t.datetime "recorded_at", precision: nil, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"blink.cmp": { "branch": "main", "commit": "4f38ce99a472932d5776337f08f7a8180f1f571a" },
|
||||
"catppuccin": { "branch": "main", "commit": "76a8d0515024cc55d8bd26fc13f1af88faef3ebf" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "1796c7cedfe7e5dd20096c5d7b8b753d8f8d22eb" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ require('lazy').setup({
|
|||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
'christoomey/vim-tmux-navigator',
|
||||
'christoomey/vim-tmux-runner',
|
||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
||||
require 'plugins/which-key',
|
||||
require 'plugins/gitsigns',
|
||||
require 'plugins/mini',
|
||||
|
|
|
|||
15
draft
|
|
@ -1,15 +0,0 @@
|
|||
x prendre billet de train
|
||||
x répondre à Laurent
|
||||
x noter agenda yaf et coopaname
|
||||
|
||||
- faire moodtracker mobile
|
||||
|
||||
- faire vaisselle
|
||||
- vider poubelles
|
||||
- demander à mathieu quel jour
|
||||
- laver drap
|
||||
- appeler athie
|
||||
|
||||
- répondre à delphine
|
||||
- redige mail julie sauzin
|
||||
|
||||
7
event.rb
|
|
@ -1,7 +0,0 @@
|
|||
class Event < ActiveRecord::Base
|
||||
default_scope { order(:taken_place_on) }
|
||||
validates_presence_of :title
|
||||
validates_presence_of :taken_place_on
|
||||
|
||||
end
|
||||
|
||||
28
mood.rb
|
|
@ -1,28 +0,0 @@
|
|||
class Mood < ActiveRecord::Base
|
||||
default_scope { order(:recorded_at) }
|
||||
validates_presence_of :mode
|
||||
validates_presence_of :recorded_at
|
||||
|
||||
def self.log
|
||||
return if Mood.count < 1
|
||||
|
||||
first_mood = Mood.first.recorded_at.to_date
|
||||
first_monday = first_mood - (first_mood.wday - 1)
|
||||
|
||||
current_date = first_monday
|
||||
current_mode = nil
|
||||
log_mood = []
|
||||
Mood.all.each do |mood|
|
||||
while current_date < mood.recorded_at.to_date do
|
||||
log_mood << [ current_date.to_s, current_mode ]
|
||||
current_date += 1
|
||||
end
|
||||
current_mode = mood.mode
|
||||
end
|
||||
while current_date <= Date.today do
|
||||
log_mood << [ current_date.to_s, current_mode ]
|
||||
current_date += 1
|
||||
end
|
||||
log_mood.each_slice(7).to_a.last(52)
|
||||
end
|
||||
end
|
||||
33
mood_app.rb
|
|
@ -1,33 +0,0 @@
|
|||
require 'sinatra/base'
|
||||
require 'sinatra/namespace'
|
||||
require 'sinatra/activerecord'
|
||||
require './mood'
|
||||
require './event'
|
||||
|
||||
class MoodApp < Sinatra::Base
|
||||
register Sinatra::ActiveRecordExtension
|
||||
register Sinatra::Namespace
|
||||
set :database, { adapter: 'sqlite3', database: "mood-#{ENV['RACK_ENV']}.sqlite3" }
|
||||
set :bind, '::1'
|
||||
|
||||
get '/' do
|
||||
@mode = Mood.last&.mode || 'croisiere'
|
||||
@mood_log = Mood.log || []
|
||||
erb :index
|
||||
end
|
||||
|
||||
namespace '/api/v1' do
|
||||
before do
|
||||
content_type 'application/json'
|
||||
end
|
||||
|
||||
post '/moods' do
|
||||
json = request.body.read
|
||||
puts json
|
||||
data = JSON.parse json
|
||||
Mood.create(mode: data['mode'], recorded_at: Time.now)
|
||||
end
|
||||
end
|
||||
|
||||
run! if app_file == $0
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
ENV['APP_ENV'] = 'test'
|
||||
|
||||
require './mood_app'
|
||||
require 'rspec'
|
||||
require 'rack/test'
|
||||
|
||||
describe 'MoodApp' do
|
||||
include Rack::Test::Methods
|
||||
|
||||
it 'says hello' do
|
||||
get '/'
|
||||
expect(last_response).to be_ok
|
||||
end
|
||||
|
||||
def app
|
||||
MoodApp
|
||||
end
|
||||
end
|
||||
42
mood_spec.rb
|
|
@ -1,42 +0,0 @@
|
|||
ENV['APP_ENV'] = 'test'
|
||||
|
||||
require './mood_app'
|
||||
require 'rspec'
|
||||
require 'timecop'
|
||||
|
||||
describe 'Mood' do
|
||||
before do
|
||||
Mood.destroy_all
|
||||
Timecop.freeze(Time.local(2024,2,10,9))
|
||||
end
|
||||
|
||||
after do
|
||||
Timecop.return
|
||||
end
|
||||
|
||||
it 'returns log' do
|
||||
Mood.create(recorded_at: '2024-02-03', mode: 'creatif')
|
||||
Mood.create(recorded_at: '2024-02-09', mode: 'en-charge')
|
||||
|
||||
expect(Mood.log).to eq [
|
||||
[
|
||||
{'2024-01-29' => nil},
|
||||
{'2024-01-30' => nil},
|
||||
{'2024-01-31' => nil},
|
||||
{'2024-02-01' => nil},
|
||||
{'2024-02-02' => nil},
|
||||
{'2024-02-03' => 'creatif'},
|
||||
{'2024-02-04' => 'creatif'}
|
||||
],
|
||||
[
|
||||
{'2024-02-05' => 'creatif'},
|
||||
{'2024-02-06' => 'creatif'},
|
||||
{'2024-02-07' => 'creatif'},
|
||||
{'2024-02-08' => 'creatif'},
|
||||
{'2024-02-09' => 'en-charge'},
|
||||
{'2024-02-10' => 'en-charge'}
|
||||
]
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 904 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 337 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 836 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 947 KiB |
187
public/main.css
|
|
@ -1,187 +0,0 @@
|
|||
body {
|
||||
margin: 0px;
|
||||
font-family: "Sour Gummy", sans-serif;
|
||||
font-weight: 350;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.mode {
|
||||
grid-area: mode;
|
||||
height: 50vh;
|
||||
}
|
||||
|
||||
.tracker {
|
||||
grid-area: tracker;
|
||||
}
|
||||
|
||||
.title {
|
||||
grid-area: title;
|
||||
margin: 30px;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.legend .bar-creatif {
|
||||
background: red;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-frigo {
|
||||
background: gray;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-croisiere {
|
||||
background: green;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-en-charge {
|
||||
background: orange;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-explain {
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
.legend-mood {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
main {
|
||||
display: block;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
grid-template-areas:
|
||||
"mode"
|
||||
"tracker";
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.mode img {
|
||||
height: 100%;
|
||||
width:100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
.tracker {
|
||||
grid-area: tracker;
|
||||
}
|
||||
.title h1 {
|
||||
font-weight: 350;
|
||||
}
|
||||
|
||||
@media (min-width: 1000px) {
|
||||
main {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr;
|
||||
grid-template-areas: "mode tracker";
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mode {
|
||||
height: 100vh;
|
||||
grid-area: mode;
|
||||
}
|
||||
.tracker {
|
||||
grid-area: tracker;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 2fr 1fr 6fr 1fr;
|
||||
grid-template-areas:
|
||||
"title title"
|
||||
"info-day info-day"
|
||||
"moods moods"
|
||||
". legend";
|
||||
background-color: lightgoldenrodyellow;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
gap: 45px;
|
||||
}
|
||||
|
||||
.title {
|
||||
grid-area: title;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
.info-day {
|
||||
grid-area: info-day;
|
||||
margin: 30px;
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.info {
|
||||
grid-area: info;
|
||||
}
|
||||
|
||||
.mode img {
|
||||
height: 100%;
|
||||
width:100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
.title h1 {
|
||||
font-weight: 350;
|
||||
}
|
||||
}
|
||||
.moods {
|
||||
grid-area: moods;
|
||||
margin: 30px;
|
||||
max-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.legend {
|
||||
grid-area: legend;
|
||||
margin: 4px;
|
||||
font-size: 0.8rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
margin: 30px;
|
||||
}
|
||||
.log {
|
||||
align-self: flex-end;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
overflow: hidden;
|
||||
}
|
||||
.moods .log .week {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-items: start;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.moods .log .day {
|
||||
border: 1px;
|
||||
margin: 4px;
|
||||
min-width: 15px;
|
||||
min-height: 15px;
|
||||
}
|
||||
.creatif {
|
||||
background-color: red;
|
||||
}
|
||||
.en-charge {
|
||||
background-color: orange;
|
||||
}
|
||||
.frigo-vide {
|
||||
background-color: grey;
|
||||
}
|
||||
.croisiere {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin: 30px;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 61 KiB |
|
|
@ -1,100 +0,0 @@
|
|||
ENV["RACK_ENV"] = 'test'
|
||||
|
||||
# This file was generated by the `rspec --init` command. Conventionally, all
|
||||
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
||||
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
||||
# this file to always be loaded, without a need to explicitly require it in any
|
||||
# files.
|
||||
#
|
||||
# Given that it is always loaded, you are encouraged to keep this file as
|
||||
# light-weight as possible. Requiring heavyweight dependencies from this file
|
||||
# will add to the boot time of your test suite on EVERY test run, even for an
|
||||
# individual file that may not need all of that loaded. Instead, consider making
|
||||
# a separate helper file that requires the additional dependencies and performs
|
||||
# the additional setup, and require it from the spec files that actually need
|
||||
# it.
|
||||
#
|
||||
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
||||
RSpec.configure do |config|
|
||||
# rspec-expectations config goes here. You can use an alternate
|
||||
# assertion/expectation library such as wrong or the stdlib/minitest
|
||||
# assertions if you prefer.
|
||||
config.expect_with :rspec do |expectations|
|
||||
# This option will default to `true` in RSpec 4. It makes the `description`
|
||||
# and `failure_message` of custom matchers include text for helper methods
|
||||
# defined using `chain`, e.g.:
|
||||
# be_bigger_than(2).and_smaller_than(4).description
|
||||
# # => "be bigger than 2 and smaller than 4"
|
||||
# ...rather than:
|
||||
# # => "be bigger than 2"
|
||||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
||||
end
|
||||
|
||||
# rspec-mocks config goes here. You can use an alternate test double
|
||||
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
||||
config.mock_with :rspec do |mocks|
|
||||
# Prevents you from mocking or stubbing a method that does not exist on
|
||||
# a real object. This is generally recommended, and will default to
|
||||
# `true` in RSpec 4.
|
||||
mocks.verify_partial_doubles = true
|
||||
end
|
||||
|
||||
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
||||
# have no way to turn it off -- the option exists only for backwards
|
||||
# compatibility in RSpec 3). It causes shared context metadata to be
|
||||
# inherited by the metadata hash of host groups and examples, rather than
|
||||
# triggering implicit auto-inclusion in groups with matching metadata.
|
||||
config.shared_context_metadata_behavior = :apply_to_host_groups
|
||||
|
||||
# The settings below are suggested to provide a good initial experience
|
||||
# with RSpec, but feel free to customize to your heart's content.
|
||||
=begin
|
||||
# This allows you to limit a spec run to individual examples or groups
|
||||
# you care about by tagging them with `:focus` metadata. When nothing
|
||||
# is tagged with `:focus`, all examples get run. RSpec also provides
|
||||
# aliases for `it`, `describe`, and `context` that include `:focus`
|
||||
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
||||
config.filter_run_when_matching :focus
|
||||
|
||||
# Allows RSpec to persist some state between runs in order to support
|
||||
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
||||
# you configure your source control system to ignore this file.
|
||||
config.example_status_persistence_file_path = "spec/examples.txt"
|
||||
|
||||
# Limits the available syntax to the non-monkey patched syntax that is
|
||||
# recommended. For more details, see:
|
||||
# https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
|
||||
config.disable_monkey_patching!
|
||||
|
||||
# This setting enables warnings. It's recommended, but in some cases may
|
||||
# be too noisy due to issues in dependencies.
|
||||
config.warnings = true
|
||||
|
||||
# Many RSpec users commonly either run the entire suite or an individual
|
||||
# file, and it's useful to allow more verbose output when running an
|
||||
# individual spec file.
|
||||
if config.files_to_run.one?
|
||||
# Use the documentation formatter for detailed output,
|
||||
# unless a formatter has already been configured
|
||||
# (e.g. via a command-line flag).
|
||||
config.default_formatter = "doc"
|
||||
end
|
||||
|
||||
# Print the 10 slowest examples and example groups at the
|
||||
# end of the spec run, to help surface which specs are running
|
||||
# particularly slow.
|
||||
config.profile_examples = 10
|
||||
|
||||
# Run specs in random order to surface order dependencies. If you find an
|
||||
# order dependency and want to debug it, you can fix the order by providing
|
||||
# the seed, which is printed after each run.
|
||||
# --seed 1234
|
||||
config.order = :random
|
||||
|
||||
# Seed global randomization in this process using the `--seed` CLI option.
|
||||
# Setting this allows you to use `--seed` to deterministically reproduce
|
||||
# test failures related to randomization by passing the same `--seed` value
|
||||
# as the one that triggered the failure.
|
||||
Kernel.srand config.seed
|
||||
=end
|
||||
end
|
||||
|
|
@ -61,3 +61,6 @@ set -g @plugin 'tmux-plugins/tpm'
|
|||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
set -g @catppuccin_flavor 'mocha'
|
||||
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="main.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Delius&family=Sour+Gummy:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
||||
|
||||
<script type="module">
|
||||
import { Application, Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js"
|
||||
window.Stimulus = Application.start()
|
||||
|
||||
Stimulus.register("mood", class extends Controller {
|
||||
static targets = [ "image", "info" ]
|
||||
|
||||
updateDayInfo(event) {
|
||||
const image = this.imageTarget;
|
||||
const infoDay = this.infoTarget;
|
||||
image.src = event.target.dataset.mode + ".jpg"
|
||||
infoDay.textContent = event.target.dataset.day;
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<main data-controller="mood">
|
||||
<div class="mode">
|
||||
<img data-mood-target="image" src="<%= @mode %>.jpg">
|
||||
</div>
|
||||
<div class="tracker">
|
||||
<div class="title">
|
||||
<h1>Comment il va le Robi ?</h1>
|
||||
</div>
|
||||
<div class="info-day" data-mood-target="info">Aujourd'hui</div>
|
||||
<div class="moods">
|
||||
<div class="log">
|
||||
<% @mood_log.each do |week| %>
|
||||
<div class="week">
|
||||
<% week.each do |d| %>
|
||||
<% if d[1] %>
|
||||
<div data-mode="<%= d[1] %>" data-day="<%= d[0] %>" data-action="mouseover->mood#updateDayInfo mouseleave->mood#updateDayInfo" title="<%= d[0] %> : <%= d[1] %>" class="day <%= d[1] %>"></div>
|
||||
<% else %>
|
||||
<div class="day"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<div class="legend-mood">
|
||||
<div class="bar-frigo"></div>
|
||||
<div class="bar-explain">Triste</div>
|
||||
</div>
|
||||
<div class="legend-mood">
|
||||
<div class="bar-en-charge"></div>
|
||||
<div class="bar-explain">En charge</div>
|
||||
</div>
|
||||
<div class="legend-mood">
|
||||
<div class="bar-croisiere"></div>
|
||||
<div class="bar-explain">Croisiere</div>
|
||||
</div>
|
||||
<div class="legend-mood">
|
||||
<div class="bar-creatif"></div>
|
||||
<div class="bar-explain">Créatif</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
26
waybar/catppuccin-latte.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
@define-color rosewater #dc8a78;
|
||||
@define-color flamingo #dd7878;
|
||||
@define-color pink #ea76cb;
|
||||
@define-color mauve #8839ef;
|
||||
@define-color red #d20f39;
|
||||
@define-color maroon #e64553;
|
||||
@define-color peach #fe640b;
|
||||
@define-color yellow #df8e1d;
|
||||
@define-color green #40a02b;
|
||||
@define-color teal #179299;
|
||||
@define-color sky #04a5e5;
|
||||
@define-color sapphire #209fb5;
|
||||
@define-color blue #1e66f5;
|
||||
@define-color lavender #7287fd;
|
||||
@define-color text #4c4f69;
|
||||
@define-color subtext1 #5c5f77;
|
||||
@define-color subtext0 #6c6f85;
|
||||
@define-color overlay2 #7c7f93;
|
||||
@define-color overlay1 #8c8fa1;
|
||||
@define-color overlay0 #9ca0b0;
|
||||
@define-color surface2 #acb0be;
|
||||
@define-color surface1 #bcc0cc;
|
||||
@define-color surface0 #ccd0da;
|
||||
@define-color base #eff1f5;
|
||||
@define-color mantle #e6e9ef;
|
||||
@define-color crust #dce0e8;
|
||||
|
|
@ -27,10 +27,11 @@
|
|||
"modules-right": [
|
||||
// informational
|
||||
"custom/weather",
|
||||
"sway/language",
|
||||
"custom/nbfiles",
|
||||
//"sway/language",
|
||||
"custom/github",
|
||||
"custom/clipboard",
|
||||
"custom/zeit",
|
||||
// "custom/zeit",
|
||||
// "cpu",
|
||||
// "temperature",
|
||||
"battery",
|
||||
|
|
@ -281,7 +282,7 @@
|
|||
"custom/weather": {
|
||||
"format": "{}",
|
||||
"tooltip": true,
|
||||
"interval": 3600,
|
||||
"interval": 30,
|
||||
// accepts -c/--city <city> -t/--temperature <C/F> -d/--distance <km/miles>
|
||||
"exec": "/usr/share/sway/scripts/weather.py",
|
||||
"return-type": "json",
|
||||
|
|
@ -400,5 +401,10 @@
|
|||
"interval": 10,
|
||||
"exec": "/home/krichtof/src/watson/waybar-watson.py"
|
||||
|
||||
},
|
||||
"custom/nbfiles": {
|
||||
"format": "{text}",
|
||||
"interval": 30,
|
||||
"exec": "ls /home/krichtof/secondbrain/entree | wc -l"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
26
waybar/frappe.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
@define-color rosewater #f2d5cf;
|
||||
@define-color flamingo #eebebe;
|
||||
@define-color pink #f4b8e4;
|
||||
@define-color mauve #ca9ee6;
|
||||
@define-color red #e78284;
|
||||
@define-color maroon #ea999c;
|
||||
@define-color peach #ef9f76;
|
||||
@define-color yellow #e5c890;
|
||||
@define-color green #a6d189;
|
||||
@define-color teal #81c8be;
|
||||
@define-color sky #99d1db;
|
||||
@define-color sapphire #85c1dc;
|
||||
@define-color blue #8caaee;
|
||||
@define-color lavender #babbf1;
|
||||
@define-color text #c6d0f5;
|
||||
@define-color subtext1 #b5bfe2;
|
||||
@define-color subtext0 #a5adce;
|
||||
@define-color overlay2 #949cbb;
|
||||
@define-color overlay1 #838ba7;
|
||||
@define-color overlay0 #737994;
|
||||
@define-color surface2 #626880;
|
||||
@define-color surface1 #51576d;
|
||||
@define-color surface0 #414559;
|
||||
@define-color base #303446;
|
||||
@define-color mantle #292c3c;
|
||||
@define-color crust #232634;
|
||||
26
waybar/macchiato.css
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
@define-color rosewater #f4dbd6;
|
||||
@define-color flamingo #f0c6c6;
|
||||
@define-color pink #f5bde6;
|
||||
@define-color mauve #c6a0f6;
|
||||
@define-color red #ed8796;
|
||||
@define-color maroon #ee99a0;
|
||||
@define-color peach #f5a97f;
|
||||
@define-color yellow #eed49f;
|
||||
@define-color green #a6da95;
|
||||
@define-color teal #8bd5ca;
|
||||
@define-color sky #91d7e3;
|
||||
@define-color sapphire #7dc4e4;
|
||||
@define-color blue #8aadf4;
|
||||
@define-color lavender #b7bdf8;
|
||||
@define-color text #cad3f5;
|
||||
@define-color subtext1 #b8c0e0;
|
||||
@define-color subtext0 #a5adcb;
|
||||
@define-color overlay2 #939ab7;
|
||||
@define-color overlay1 #8087a2;
|
||||
@define-color overlay0 #6e738d;
|
||||
@define-color surface2 #5b6078;
|
||||
@define-color surface1 #494d64;
|
||||
@define-color surface0 #363a4f;
|
||||
@define-color base #24273a;
|
||||
@define-color mantle #1e2030;
|
||||
@define-color crust #181926;
|
||||
221
waybar/style.css
|
|
@ -1,4 +1,223 @@
|
|||
@import "/usr/share/sway/templates/waybar/style.css";
|
||||
@import "catppuccin-mocha.css";
|
||||
/* =============================================================================
|
||||
*
|
||||
* Waybar configuration
|
||||
*
|
||||
* Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
|
||||
*
|
||||
* =========================================================================== */
|
||||
|
||||
/* import css definitions for current theme */
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Keyframes
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
@keyframes blink-warning {
|
||||
70% {
|
||||
color: @wm_icon_bg;
|
||||
}
|
||||
|
||||
to {
|
||||
color: @wm_icon_bg;
|
||||
background-color: @warning_color;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes blink-critical {
|
||||
70% {
|
||||
color: @wm_icon_bg;
|
||||
}
|
||||
|
||||
to {
|
||||
color: @wm_icon_bg;
|
||||
background-color: @error_color;
|
||||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Base styles
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
/* Reset all styles */
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "JetBrainsMono NF", "Roboto Mono", sans-serif;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
/* you can also GTK3 CSS functions! */
|
||||
background-color: shade(@base, 0.9);
|
||||
border: 2px solid alpha(@crust, 0.3);
|
||||
}
|
||||
|
||||
|
||||
/* Each module */
|
||||
#custom-pacman,
|
||||
#custom-menu,
|
||||
#custom-help,
|
||||
#custom-scratchpad,
|
||||
#custom-github,
|
||||
#custom-clipboard,
|
||||
#custom-zeit,
|
||||
#custom-dnd,
|
||||
#custom-valent,
|
||||
#custom-idle_inhibitor,
|
||||
#bluetooth,
|
||||
#battery,
|
||||
#clock,
|
||||
#cpu,
|
||||
#memory,
|
||||
#mode,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#language,
|
||||
#custom-adaptive-light,
|
||||
#custom-sunset,
|
||||
#custom-playerctl,
|
||||
#custom-weather,
|
||||
#tray {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Module styles
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
#custom-scratchpad,
|
||||
#custom-menu,
|
||||
#workspaces button.focused,
|
||||
#clock {
|
||||
color: @theme_bg_color;
|
||||
background-color: @theme_selected_bg_color;
|
||||
}
|
||||
|
||||
#custom-zeit.tracking {
|
||||
background-color: @warning_color;
|
||||
}
|
||||
|
||||
#battery {
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#battery.warning {
|
||||
color: @warning_color;
|
||||
}
|
||||
|
||||
#battery.critical {
|
||||
color: @error_color;
|
||||
}
|
||||
|
||||
#battery.warning.discharging {
|
||||
animation-name: blink-warning;
|
||||
animation-duration: 3s;
|
||||
}
|
||||
|
||||
#battery.critical.discharging {
|
||||
animation-name: blink-critical;
|
||||
animation-duration: 2s;
|
||||
}
|
||||
|
||||
#clock {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#cpu.warning {
|
||||
color: @warning_color;
|
||||
}
|
||||
|
||||
#cpu.critical {
|
||||
color: @error_color;
|
||||
}
|
||||
|
||||
#custom-menu {
|
||||
padding-left: 8px;
|
||||
padding-right: 13px;
|
||||
}
|
||||
|
||||
#memory {
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#memory.warning {
|
||||
color: @warning_color;
|
||||
}
|
||||
|
||||
#memory.critical {
|
||||
color: @error_color;
|
||||
animation-name: blink-critical;
|
||||
animation-duration: 2s;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background: @background_color;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
color: @warning_color;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
color: @warning_color;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
color: @error_color;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
border-top: 2px solid transparent;
|
||||
/* To compensate for the top border and still have vertical centering */
|
||||
padding-bottom: 2px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
color: @theme_selected_bg_color;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
border-color: @theme_selected_bg_color;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
border-color: @error_color;
|
||||
color: @error_color;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
color: @theme_bg_color;
|
||||
}
|
||||
|
||||
#custom-pacman {
|
||||
color: @warning_color;
|
||||
}
|
||||
|
||||
#bluetooth.disabled {
|
||||
color: @warning_color;
|
||||
}
|
||||
|
||||
#custom-wf-recorder {
|
||||
color: @error_color;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#custom-valent.dangerously-empty {
|
||||
color: @warning_color;
|
||||
}
|
||||
#custom-uair.resumed {
|
||||
color: #f87171;
|
||||
}
|
||||
#custom-watson.nothing {
|
||||
color: #f87171;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,3 +215,9 @@ window#waybar {
|
|||
#custom-valent.dangerously-empty {
|
||||
color: @warning_color;
|
||||
}
|
||||
#custom-uair.resumed {
|
||||
color: #f87171;
|
||||
}
|
||||
#custom-watson.nothing {
|
||||
color: #f87171;
|
||||
}
|
||||
|
|
|
|||
4
waybar/style_orig.css
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
@import "/usr/share/sway/templates/waybar/style.css";
|
||||
#custom-uair.resumed {
|
||||
color: #f87171;
|
||||
}
|
||||
9
zshrc
|
|
@ -9,9 +9,9 @@ if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
|
|||
source /usr/share/zsh/manjaro-zsh-config
|
||||
fi
|
||||
# Use manjaro zsh prompt
|
||||
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
|
||||
source /usr/share/zsh/manjaro-zsh-prompt
|
||||
fi
|
||||
#if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
|
||||
# source /usr/share/zsh/manjaro-zsh-prompt
|
||||
#fi
|
||||
|
||||
PATH=$HOME/.local/bin:$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH
|
||||
EDITOR=nvim
|
||||
|
|
@ -22,5 +22,8 @@ if [[ -e $HOME/.config/zsh/autocomplete_zeit ]]; then
|
|||
source $HOME/.config/zsh/autocomplete_zeit
|
||||
fi
|
||||
|
||||
source ~/.zsh/catppuccin_latte-zsh-syntax-highlighting.zsh
|
||||
# source ~/.zsh/catppuccin_mocha-zsh-syntax-highlighting.zsh
|
||||
|
||||
set -o vi
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
|
|
|
|||