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 | |
if ['--help', '-h'].include?(ARGV[0]) || ARGV.size != 2 | |
puts <<-EOT | |
Make web application shortcut | |
Usage: makewebapp <name> <URL> | |
EOT | |
exit | |
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
Section "InputClass" | |
Identifier "keyboard defaults" | |
MatchIsKeyboard "on" | |
Option "XKbOptions" "caps:lctrl,ctrl:swap_lalt_lctl" | |
EndSection |
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
class String | |
def hashify | |
"##{gsub(' ', '_')}" | |
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
def day_json | |
ids = popular_people.pluck(:id).join('.') | |
Rails.cache.fetch("pc/dj/#{ids}") do | |
render_to_string json: popular_people | |
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
We Found 52 Days, Yaaay: | |
2016-08-06 | |
2016-08-13 | |
2016-08-20 | |
2016-08-27 | |
2016-09-03 | |
2016-09-10 | |
2016-09-17 | |
2016-09-24 | |
2016-10-01 |
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
'use strict' | |
let Stack = function(max){ | |
if(typeof max != 'number' || max == NaN){ | |
throw new Error(max + ' should be a number'); | |
} | |
var Store = [], | |
top = 0, | |
empty = function() { return top === 0; }, |
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
def time(&block) puts Benchmark.measure(&block) 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
class SimpleGit | |
def self.git(method_name, cmd = nil) | |
define_method(method_name) do |args| | |
if cmd | |
git("#{cmd} #{args}") | |
else | |
git("#{method_name} #{args}") | |
end | |
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
AllCops: | |
Exclude: | |
- 'vendor/**/*' | |
- 'db/schema.rb' | |
- 'db/migrate/**/*' | |
Metrics/LineLength: | |
Enabled: false | |
Style/Documentation: | |
Enabled: false | |
Style/StringLiterals: |
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
# manages your string in terminal, each call to rendr will clear the old string | |
# and print the new one | |
# Extracted from | |
# https://github.com/arlimus/inquirer.rb/blob/master/lib/inquirer/utils/iohelper.rb | |
module Buffer | |
extend self | |
CARRIAGE_RETURN = "\r".freeze | |
LINE_UP = "\e[A".freeze | |
CLEAR_LINE = "\e[0K".freeze |