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
irb | |
require 'pp'; command = {}; `cat .bash_history`.split("\n").map{|x| x.split(" ").first }.each{|c| command[c] ||= 0; command[c] += 1 }; pp command.sort{|x,y| x[1] <=> y[1] } |
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
Vagrant::Config.run do |config| | |
config.vm.forward_port("ssh", 22, 2222) | |
config.vm.forward_port("riak", 8098, 8098) | |
config.vm.box = "base" | |
config.vm.provisioner = :chef_solo | |
config.chef.cookbooks_path = "cookbooks" | |
config.chef.run_list.clear | |
config.chef.add_recipe("riak") |
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
# rails new [appname] -JT -m https://gist.githubusercontent.com/paulmars/960988/raw/386eb14e20153ef4d55a6735d22748c6503b64f8/template.rb | |
# rails new APPNAME -JT -m /Users/paul/Development/template/template.rb | |
# sass | |
gem 'sass-rails' | |
gem 'bootstrap-sass', '3.2.0.2' | |
# image update | |
gem 'carrierwave', '0.10.0' | |
gem 'fog', '1.19.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
server { | |
listen 443; | |
} | |
server { | |
listen 80; | |
rewrite ^(.*) https://$host$1 permanent; | |
} |
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
Source: | |
http://stackoverflow.com/questions/6312448/how-to-disable-logging-of-asset-pipeline-sprockets-messages-in-rails-3-1 | |
mate config/initializers/quiet_assets.rb | |
Paste: | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level |
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
where 10.0.1.255 is the subnet mast | |
~ ping 10.0.1.255 | |
PING 10.0.1.255 (10.0.1.255): 56 data bytes | |
64 bytes from 10.0.1.193: icmp_seq=0 ttl=64 time=0.190 ms | |
64 bytes from 10.0.1.1: icmp_seq=0 ttl=255 time=2.565 ms | |
64 bytes from 10.0.1.11: icmp_seq=0 ttl=64 time=583.688 ms | |
64 bytes from 10.0.1.19: icmp_seq=0 ttl=64 time=583.944 ms | |
64 bytes from 10.0.1.21: icmp_seq=0 ttl=255 time=586.059 ms | |
64 bytes from 10.0.1.193: icmp_seq=1 ttl=64 time=0.205 ms |
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
sys = require 'sys' | |
exports.paramsLogger = () -> | |
(req, res, next) -> | |
console.log("Query: " + sys.inspect(req.query)) if req.query | |
console.log("Body: " + sys.inspect(req.body)) if req.body | |
console.log("=============") | |
next() |
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
{ | |
"auto_complete": false, | |
"caret_style": "phase", | |
"draw_minimap_border": true, | |
"file_exclude_patterns": | |
[ | |
".out", | |
".DS_Store", | |
"dblocal.sql" | |
], |
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 | |
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll. | |
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
# Configuration |
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 | |
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll. | |
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll | |
# Supports post types: regular, quote, link, photo, video and audio | |
# Saves local copies of images | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' |
OlderNewer