This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# vi: ft=sh | |
# Toggle hyprland kb_variant between qwerty and dvorak | |
# Optional first arg is the path to hyprland.conf | |
# defaults to ~/.config/hypr/hyprland.conf | |
# | |
# Put this in something like ~/.config/hypr/bin/toggle_layout, | |
# chmod +x it, and add some binding like this: | |
# bind = $mainMod SHIFT, T, exec, /home/<your_username>/.config/hypr/bin/toggle_layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; recur-event - dispatch vector for when target isn't reached | |
;; :root-path - Where is this iteration state to be kept in the app-db? | |
;; :unwrap - pre process step-ret. Identity by default. Example: parse json and get body key of response | |
;; unwrap output is input for nextf, reachedp, updatef, somep | |
;; :somep - Are there more items in this request? If not, consider this to be the end of available items | |
;; :nextf - Get next cursor value | |
;; :updatef - Update values - takes old values and output of unwrap, update iteration values in app-db | |
;; :reachedp - Did the cursor reach the desired item? passed ret val of nextf, is nextf by default | |
(rf/reg-event-fx | |
::iteration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# forgive me for any noob stuff, this is like my second dockerfile :P | |
FROM ruby:2.3-alpine | |
WORKDIR /app | |
COPY Gemfile* ./ | |
# the --virtual <name> flag groups packages by name. I use this (sometimes) to remove build deps once everything is installed. | |
# All bulid stuff in one RUN command to reduce number of image layers | |
RUN apk update && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(fn [coll] | |
(let [parduction-by (fn [predf coll] (->> (partition 2 1 coll) (partition-by predf) (filter #(some predf %)) (map #(mapcat identity %)) (map dedupe))) | |
inc? (fn [[a b]] (= (inc a) b))] | |
(->> (parduction-by inc? coll) (sort-by count) last))) | |
;; for an example of what parduction-by does, it's basically a combination of partition-by, reduce and filter | |
;; I'd like to take out the filter aspect and leave that for the user. | |
(parduction-by inc? '(1 0 1 2 3 0 4 5)) ;; => '((0 1 2 3) (4 5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Roughly based on my https://github.com/hxegon/aok_product/blob/e417b2bc6df9d772d09bb025e502c46a548d55e9/lib/extractor.rb | |
# This possibley has a bug in Browser, with @@actions being a class instance var. Might be fixable by changing @browsers to | |
# class inst var, and adding during #add_action instead of pushing it off too #initialize | |
class Implementations | |
# Keeps track of what browsers are available, and what their actions are. | |
# default is what get returned when nothing matches the action_list you give #for | |
def initialize(actions=[], default:nil) | |
# actions format: [(class_name, action_name)], good candidate for class extraction or just a struct | |
@default = default | |
actions.each { |(action_name, class_name| add_action(class_name, action_name) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeClass | |
def initialize(current_account, form, request) | |
@form = form | |
@request = request | |
end | |
def call | |
if invalid? | |
form.errors.add(:credentials, :invalid) | |
return broadcast(:invalid, form) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
group :development do | |
gem 'rake' | |
gem 'guard', require: false | |
gem 'guard-rspec', require: false | |
end | |
group :development, :testing do | |
gem 'dotenv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo | |
def bar | |
"#{to_s} whizbang" | |
end | |
end | |
describe Foo do | |
describe "#bar" do | |
it "works" do | |
base = Class.new { include Foo } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def map_product_strings(prod_val, &block) | |
# product hash -> product hash with strings changed through block | |
case prod_val | |
when Hash | |
Hash[prod_val.map {|key, val| [key, map_product_strings(val, &block)]}] | |
when Array | |
prod_val.map { |v| map_product_strings(v, &block) } | |
when String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT | |
remote: git://github.com/spree/spree_auth_devise.git | |
revision: b554f307e5aa887110a70d54f8967c284f881375 | |
branch: 3-0-stable | |
specs: | |
spree_auth_devise (3.0.0) | |
devise (~> 3.4.1) | |
devise-encryptable (= 0.1.2) | |
json | |
multi_json |
NewerOlder