Skip to content

Instantly share code, notes, and snippets.

View millisami's full-sized avatar
🎯
Focusing on landing a Web3 Job

Sachin Sagar Rai millisami

🎯
Focusing on landing a Web3 Job
View GitHub Profile
@millisami
millisami / .rspec
Created January 11, 2013 16:14 — forked from coreyhaines/.rspec
--colour
-I app
@millisami
millisami / install-ruby-2.0.0.sh
Created November 8, 2012 17:02 — forked from sferik/install-ruby-2.0.0.sh
Instructions to install on Ruby 2.0.0 on Mac OS X with homebrew
#!/usr/bin/env sh
brew update
brew install rbenv
brew install ruby-build
brew install openssl
CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview1
@millisami
millisami / gist:3806281
Created September 30, 2012 08:47 — forked from jtimberman/gist:3088517
Replace BOXNAME with boxe names that should be repackaged with updates
% vagrant up --no-provision BOXNAME
% vagrant ssh BOXNAME
vagrant$ wget -O - http://opscode.com/chef/install.sh | sudo bash
vagrant$ rm /tmp/chef*{rpm,deb}
vagrant$ exit
% vagrant package BOXNAME
% rm -rf ~/.vagrant.d/boxes/BOXNAME
% vagrant box add BOXNAME package.box
@millisami
millisami / gist:3798773
Created September 28, 2012 09:04 — forked from juanje/gist:3797297
Mount apt cache of a Vagrant box in the host to spin up the packages installation

This is a little trick I use to spin up the packages instalation on Debian/Ubuntu boxes in Vagrant.

I add a simple function that checks if a directory named something similar to ~/.vagrant.d/cache/apt/opscode-ubuntu-12.04/partial (it may have another path in Windows or MacOS) and create the directory if it doesn't already exist.

def local_cache(box_name)
  cache_dir = File.join(File.expand_path(Vagrant::Environment::DEFAULT_HOME),
                        'cache',
                        'apt',
                        box_name)
@millisami
millisami / bluepill_config.conf
Created September 25, 2012 08:00 — forked from garrensmith/bluepill_config.conf
Bluepill Upstart
description "Demo app Bluepill"
start on runlevel [2]
stop on runlevel [016]
expect daemon
exec bluepill load /var/my_app/current/config/staging.pill
respawn
@millisami
millisami / gist:3731707
Created September 16, 2012 09:14 — forked from mhorbul/gist:3726422
set an attribute on the node
# Knife plugin to set an attribute on the node
# Usage:
# $knife node exec [nodename] 'node.set[:somevalue] = true'
class NodeExec < Chef::Knife
banner "knife node exec NODE CODE (options)"
deps do
require 'chef/search/query'
end
@millisami
millisami / gist:3691725
Created September 10, 2012 15:58 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@millisami
millisami / geoip_service.rb
Created September 3, 2012 12:18 — forked from mislav/geoip_service.rb
Simple GeoIP service class using freegeoip.net and Faraday
require 'faraday_middleware'
require 'hashie/mash'
# Public: GeoIP service using freegeoip.net
#
# See https://github.com/fiorix/freegeoip#readme
#
# Examples
#
# res = GeoipService.new.call '173.194.64.19'
@millisami
millisami / perferences.json
Created August 22, 2012 11:17 — forked from soffes/perferences.json
My Sublime Text 2 config
{
"auto_complete_delay": 100,
"caret_style": "blink",
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"draw_minimap_border": false,
"ensure_newline_at_eof_on_save": false,
"font_face": "Monaco",
"font_size": 15.0,
"highlight_line": true,
"file_exclude_patterns":
@millisami
millisami / code.rb
Created August 3, 2012 08:41 — forked from caius/code.rb
require "uri"
(URI::REGEXP.constants - ["PATTERN"]).each do |rc|
puts "#{rc}: #{URI::REGEXP.const_get(rc)}"
end
URI::REGEXP::PATTERN.constants.each do |pc|
puts "#{pc}: #{URI::REGEXP::PATTERN.const_get(pc)}"
end