Skip to content

Instantly share code, notes, and snippets.

View faun's full-sized avatar
🌵

Faun faun

🌵
View GitHub Profile
@faun
faun / node-and-npm-in-30-seconds.sh
Created May 24, 2011 22:34 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@faun
faun / build.sh
Created September 6, 2011 21:55 — forked from kossnocorp/USAGE.md
Install latest MacVim with Drawer
git clone -b split-browser https://github.com/alloy/macvim.git && cd macvim && ./configure --with-features=huge --enable-cscope --enable-rubyinterp --enable-pythoninterp --enable-perlinterp && make && sudo rm -rf /Applications/MacVim.app && sudo mv ./src/MacVim/build/Release/MacVim.app /Applications
@faun
faun / ios-media-queries.sass
Created November 28, 2011 21:33 — forked from adamstac/ios-media-queries.sass
iOS Media Queries for iPhone/iPod, iPad & Retina and Non-Retina Devices
.ipad-only,
.iphone-only,
.retina-only,
.non-retina-only,
.retina-iphone-only,
.non-retina-iphone-only
display: none
// iPad Only
@media only screen and (device-width: 768px)
class TripsController < ApplicationController
class Action < ApplicationController::Action
end
class New < Action
expose(:trip) { Trip.new(params[:trip]) }
end
class Create < New
def call
@mixin retina($ratio: 1.5) {
$dpi: $ratio * 96;
$opera-ratio: $ratio * 100;
@media only screen and (-webkit-min-device-pixel-ratio: #{$ratio}),
only screen and ( -o-min-device-pixel-ratio: '#{$opera-ratio}/100'),
only screen and ( min-resolution: #{$dpi}dpi),
only screen and ( min-resolution: #{$ratio}dppx) {
@content;
}
#!/usr/bin/env bash
set -e
find assets resource -name "*.png" -exec optipng -o7 {} \;
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: provide a title argument."
exit -1
else
title="$@"
fi
d=$(date +"%Y-%m-%d")
class UsersController < ApplicationController
def create
@user = User.new params[:user]
return render 'new' unless @user.save
flash[:notice] = "The user was created succesfully"
redirect_to :index
end
class UsersController < ApplicationController
def create
@user = User.new params[:user]
return render 'new' unless @user.save
flash[:notice] = "The user was created succesfully"
redirect_to :index
end
@faun
faun / vim.rb
Created October 22, 2013 04:38 — forked from mgrouchy/vim.rb
Install with: brew install https://gist.github.com/faun/7095304/raw/1a08f9403196f9e493d8b7a037acff5ed9992348/vim.rb --enable-interp=python,ruby --with-features=big
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end