Skip to content

Instantly share code, notes, and snippets.

View Farzy's full-sized avatar

Farzad FARID Farzy

View GitHub Profile
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/vimbundle/bundle/vundle/
call vundle#rc()
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-git'
Bundle 'tpope/vim-haml'
Bundle 'pangloss/vim-javascript'
@jnx
jnx / rbenv-install-system-wide.sh
Created October 1, 2011 20:09
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
filesystem will be different but this guide will get you working with it
while we wait for all that to finalize.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention
@jedi4ever
jedi4ever / apt_default.rb
Created March 2, 2011 13:23
Adapted chef apt default recipe
# Adapted because otherwise it will do an update everytime
#http://blog.kumina.nl/2010/11/puppet-tipstricks-running-apt-get-update-only-when-needed/
#
# Cookbook Name:: apt
# Recipe:: default
#
# Copyright 2008-2009, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
ruby_block "Verify running processed" do
block do
missing_processes = []
[
"jetty",
"nginx",
"mongodb-#{node[:mongodb][:version]}",
"redis-#{node[:redis][:version]}"
].each do |process|
Chef::Log.debug("Checking process #{process}")
@igrigorik
igrigorik / ruby-1.9-tips.rb
Created February 3, 2011 17:19
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@thbar
thbar / chef-solo-databags.rb
Created February 1, 2011 16:54
Provided by Brian Akins on the chef mailing list: "This is our extremely simple implementation of data bags for chef-solo. Add "data_bag_path /some/dir/data_bags" to your solo.rb and add this into your libraries"
if Chef::Config[:solo]
class Chef
module Mixin
module Language
def data_bag(bag)
@solo_data_bags = {} if @solo_data_bags.nil?
unless @solo_data_bags[bag]
@solo_data_bags[bag] = {}
Dir.glob(File.join(Chef::Config[:data_bag_path], bag,
#!/usr/bin/env ruby
require 'rubygems'
require 'chef'
require 'chef/client'
require 'chef/run_context'
Chef::Config[:solo] = true
Chef::Config[:log_level] = :info
Chef::Log.level(:info)
@tdd
tdd / config-bash-pour-un-prompt-git-de-tueur.bash
Last active April 17, 2024 10:04
Config Bash pour un prompt Git de tueur
# STEP 1: ENSURE COMPLETION AND PROMPT FUNCTION ARE LOADED
# ========================================================
# OPTION 1: If on OSX using Homebrew:
#
# source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh
# source $(brew --prefix)/etc/bash_completion.d/git-completion.bash
# OPTION 2: If on OSX using built-in Git (also works on ZSH):
#
# Check this out, rvm use rbx
ruby_block "rvm use rbx" do
block do
Chef::Mixin::Command.popen4('bash -l -c "rvm use 1.9.1 && env"') do |p,i,o,e|
o.each_line do |line|
env_bits = line.split("=")
ENV[env_bits[0]] = env_bits[1]
end
end