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
# Simple but necessary script (for Mac) to announce when the beer time is comming | |
# You can configure your crontab like this | |
# 0 17 * * 5 ruby $HOME/scripts/beer_time.rb >> /var/log/beer_time.log 2>&1 | |
beer_hour = ARGV[0] || 18 | |
def say(message) | |
`afplay /System/Library/Sounds/Hero.aiff` | |
`afplay /System/Library/Sounds/Hero.aiff` | |
`say "#{message}"` |
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
require "csv" | |
module Script | |
def self.run(input_path, output_path) | |
log = File.read(input_path) | |
lines_count = log.lines.count | |
index = 0 | |
File.open(output_path, "w") do |output_file| |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
robotName: '', | |
robots: Ember.ArrayProxy.create({ content: Ember.A([ | |
{ name: "Mazinger Z" }, | |
{ name: "Lady Electric" } | |
])}), | |
actions: { |
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
import Ember from 'ember'; | |
function trackPropertyChanges(defaultValue) { | |
var value = defaultValue; | |
function updateChangedProperty(model, name, property, value) { | |
var changedProperties = model.get('changedProperties'); | |
if (!changedProperties) { | |
changedProperties = Ember.Object.create(); | |
model.set('changedProperties', changedProperties); |
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
alias dr="cd ~/Develop/Rails/Current" | |
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" | |
alias gitfast="git add . && git add -u && git commit -m 'WIP'" | |
alias gitci="git push -f fguillen HEAD:ci" | |
alias rgrep="find . \( ! -name .svn -o -prune \) -type f -print0 | xargs -0 grep" | |
alias raca="rake" | |
alias rt="ruby -Itest" | |
alias to="touch tmp/restart.txt" | |
alias deployeverywhere=" git push origin HEAD:staging && git push origin HEAD:production && cap staging deploy && cap production deploy" |
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
find /var/www/*/shared/log -name "*.log" -exec truncate {} --size 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
require "benchmark" | |
require "logger" | |
require "resolv" | |
module Script | |
def self.run(process_name, resolv_kind, dns_server_ip, nameserver_to_resolv) | |
file = File.open("/tmp/dns_resolution_stress.log", File::WRONLY | File::APPEND) | |
logger = Logger.new(file) | |
logger.level = Logger::DEBUG |
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
# ~/.aliasesrc | |
# tree visualization of your actual folder | |
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" | |
# Making a fast (temporal) commit of all your changes | |
alias gitfast="git add . && git add -u && git commit -m 'WIP'" | |
# Pushing to the CI branch | |
alias gitci="git push -f fguillen HEAD:ci" |
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
tail -f /var/log/nginx.log | awk ' | |
/status:"2.."/ {print "\033[32m" $0 "\033[39m"} | |
/status:"5.."/ {print "\033[31m" $0 "\033[39m"} | |
/status:"[^25].."/ {print $0} | |
' |