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
javascript:setTimeout(function(){ | |
var m = window.location.href.match(/trello.com\/c\/[A-z\d]+\/(\d+)/); | |
if(m){ | |
var text = new Date().toLocaleDateString("en-US") + "\t" + | |
'=HYPERLINK("'+m[0]+'","'+m[1]+'")' + "\t" + | |
document.querySelector('div.window-title>textarea').value; | |
navigator.clipboard.writeText(text); | |
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
[Ll]ibrary/ | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild/ | |
[Bb]uilds/ | |
Assets/AssetStoreTools* | |
# Visual Studio cache directory | |
.vs/ |
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
Should be added to /etc/network/if-pre-up.d/iptable_rules | |
Don't forget to run | |
chmod +x /etc/network/if-pre-up.d/iptable_rules |
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 Object | |
def self.my_decorator(method_name) | |
alias_method "#{method_name}_without_my_decorator", method_name | |
define_method method_name do | |
puts "My decorator logic starts" | |
result = send("#{method_name}_without_my_decorator") | |
puts "My decorator logic ends" | |
result | |
end |
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 ruby | |
def process_folders(message, *folders, &block) | |
root = File.expand_path('../..', __FILE__) | |
puts message | |
puts | |
total_old = 0 | |
total_new = 0 |
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
ffmpeg -i input.mkv -map 0:0 -map 0:2 -c:v copy -c:a:0 copy output.mp4 |
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
CLAN_ID = 1 | |
clan = Clan.find(CLAN_ID) | |
character_ids = ClanMember.connection.select_values( | |
ClanMember.send(:sanitize_sql, ["SELECT character_id FROM clan_members WHERE clan_id = :clan", :clan => clan.id]) | |
) | |
position = 0 |
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 backup(path, redis) | |
keys = redis.keys | |
puts "#{ keys.size } keys to dump" | |
File.open(path, 'w+') do |f| | |
keys.each_with_index do |key, i| | |
next unless dump = redis.dump(key) | |
f.puts JSON.dump([key, dump.force_encoding('utf-8')]).force_encoding('utf-8') |
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
[mysql] | |
# CLIENT # | |
port = 3306 | |
socket = /var/lib/mysql/mysql.sock | |
[mysqld] | |
# GENERAL # | |
user = mysql |
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
cd ~ | |
curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
echo ' | |
export RBENV_ROOT="${HOME}/.rbenv" | |
if [ -d "${RBENV_ROOT}" ]; then |
NewerOlder