$ dpkg -L ulauncher | grep service
This file contains hidden or 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
[1] pry(#<Context>)> u = User.new(user_id: "disobedientlib") | |
=> #<BggTools::User:0x0000000106557fb0 @user_id="disobedientlib"> | |
[2] pry(#<Context>)> u.owned.map(&:rating).select { |r| r.to_i > 0 }.flat_map { |r| r.item.mechanics.map { |m| [m, r.to_i]}}.group_by {|k,v|k}.select { |k,v| v.size > 4 }.map {|k,v| [k, v.map(&:last).mean.round(2), v.size]}.sort_by {|k,v,p| -v}.first(15) | |
=> [["Deck Construction", 8.67, 6], | |
["Simulation", 8.42, 12], | |
["Turn Order: Progressive", 8.36, 11], | |
["Card Play Conflict Resolution", 8.36, 14], | |
["Hexagon Grid", 8.33, 15], | |
["Campaign / Battle Card Driven", 8.3, 10], | |
["Tags", 8.29, 7], |
This file contains hidden or 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
https://mazzo.li/posts/fast-pipes.html |
This file contains hidden or 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 ruby | |
require 'nokogiri' | |
require 'set' | |
class Object | |
def as_node | |
Node.new(self) | |
end | |
end |
This file contains hidden or 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
Power and Politics in Today's World: https://www.youtube.com/playlist?list=PLh9mgdi4rNeyViG2ar68jkgEi4y6doNZy | |
Financial Markets: https://www.youtube.com/playlist?list=PL8FB14A2200B87185 | |
The Moral Foundations of Politics: https://www.youtube.com/playlist?list=PL2FD48CE33DFBEA7E | |
Environmental Politics and Law: https://www.youtube.com/playlist?list=PL84DCD72C5B5DC403 | |
Financial Theory: https://www.youtube.com/playlist?list=PLEDC55106E0BA18FC |
This file contains hidden or 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
$ docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
2cdef4202c1c cg-ruby-sem_sem "rails c" 19 minutes ago Up 19 minutes 3000/tcp cg-ruby-sem_sem_run_73d6529b9b23 | |
$ cat Dockerfile.debug | |
FROM alpine | |
RUN apk update && apk add strace | |
CMD ["strace", "-p", "1"] | |
$ docker build -f Dockerfile.debug -t strace . |
This file contains hidden or 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
<location>\(-\{-}\d\+\),\(-\{-}\d\+\)<\/location> |
This file contains hidden or 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
# Usage: find app/models -name '*.rb' | xargs -n 1 ruby find_unreferenced.rb | |
require 'parser/current' | |
class ASTProcessor | |
include AST::Processor::Mixin | |
attr_reader :possibly_unreferenced | |
def initialize | |
@possibly_unreferenced = [] |
This file contains hidden or 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 ruby | |
require 'tty/prompt' | |
require 'tty/prompt/vim' | |
prompt = TTY::Prompt.new | |
branches = `git for-each-ref --sort=-committerdate --count=20 --format='%(refname:short)' refs/heads/`.each_line.map(&:rstrip) | |
branch = prompt.select("Choose a branch:", branches) | |
exec "git checkout #{branch}" |
This file contains hidden or 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
# Processes nodes in depth-first order | |
class DepthFirstTraversal | |
def initialize(root, hierarchy = nil) | |
@root = root | |
@hierarchy = hierarchy | |
end | |
def traverse | |
stack = [@root] | |
order = [] |
NewerOlder