Skip to content

Instantly share code, notes, and snippets.

View vortizhe's full-sized avatar

Victor Ortiz vortizhe

View GitHub Profile
@vortizhe
vortizhe / rawclone.rb
Created July 18, 2011 11:28 — forked from littlemove/rawclone.rb
Reads a file with the output from gem list and installs the gems
#! /usr/bin/ruby
# So you want to start developing an already "woking" project. No
# bundle, config.gem's not present or messing up dependencies. Fear
# not!
# Do a "gem list" wherever the project is already working
# (production?, some colleage machine?). Make a file with this format:
#
# chronic (0.2.3)
# colored (1.1)
alias branch="git branch 2>/dev/null | grep '*' | sed 's/\* //'"
alias p='git fetch origin && git rebase -p origin/`branch`'
alias pm='git fetch origin && git merge origin/`branch`'
alias P='git push origin `branch`'
@vortizhe
vortizhe / rawclone_bundler.rb
Created November 28, 2011 12:48 — forked from rsierra/rawclone_bundler.rb
Script para generar el Gemfile de bundler a partir de un 'gem list'
#!/usr/bin/env ruby
# So you want to start developing an already "woking" project. No
# bundle, config.gem's not present or messing up dependencies. Fear
# not!
# Do a "gem list" wherever the project is already working
# (production?, some colleage machine?). Make a file with this format:
#
# chronic (0.2.3)
# colored (1.1)
@vortizhe
vortizhe / gist:3273617
Created August 6, 2012 11:12
Font Family Lucida Sans
body {
font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
color:#2F2F2F;
}
strong, em, b, i {
font-family: "Lucida Sans", "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
color:#2F2F2F;
}
@vortizhe
vortizhe / gist:3304584
Created August 9, 2012 14:20
Smooth scroll
$('.selector').click(function(e){
e.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);
});
@vortizhe
vortizhe / gist:3341081
Created August 13, 2012 14:08
Extend RefineryCMS wysiwyg
rake refinery:override javascript=admin
admin.js
if (typeof(custom_wymeditor_boot_options) == "undefined") {
custom_wymeditor_boot_options = {
classesItems: [
{name: 'text-align', rules:[{name: 'left', title: '{Left}'}, {name: 'center', title: '{Center}'}, {name: 'right', title: '{Right}'}, {name: 'justify', title: '{Justify}'}], join: '-', title: '{Text_Align}'}
, {name: 'image-align', rules:[{name: 'left', title: '{Left}'}, {name: 'right', title: '{Right}'}], join: '-', title: '{Image_Align}'}
, {name: 'font-size', rules:[{name: 'small', title: '{Small}'}, {name: 'normal', title: '{Normal}'}, {name: 'large', title: '{Large}'}], join: '-', title: '{Font_Size}'}
@vortizhe
vortizhe / gist:3370006
Created August 16, 2012 13:10
Unicorn Fix - Update gemfile after deploy
before_exec do |server|
ENV["BUNDLE_GEMFILE"] = "/var/www/proyectname/current/Gemfile"
end
@vortizhe
vortizhe / gist:3468682
Created August 25, 2012 18:09
Osx tweaks - Extract from mathiasbynens / dotfiles
#!/bin/bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@vortizhe
vortizhe / gist:3830149
Created October 3, 2012 21:57
Raindrop gem install error
libatomic_ops is required if GCC 4+ is not used.
Download http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-7.2d.tar.gz
./configure --prefix=/usr/local
make
make check
make install
@vortizhe
vortizhe / gist:3852053
Created October 8, 2012 11:36
Font-face with rails 3.2 asset pipeline
/***** SCSS *****/
@font-face {
font: {
family: 'family';
weight: 'normal';
style: 'normal';
}
src: asset-url('webfont.eot', font);
src: asset-url('webfont.eot', font) format('embedded-opentype'),
asset-url('webfont.woff', font) format('woff'),