Skip to content

Instantly share code, notes, and snippets.

View rogeruiz's full-sized avatar

Roger Steve Ruiz rogeruiz

View GitHub Profile
@rogeruiz
rogeruiz / .tmux.conf
Created April 11, 2012 18:19 — forked from rattlion/.tmux.conf
tmux conf
set -g default-terminal "screen-256color"
set -g status-utf8 on
bind M source-file ~/.tmux/mac.session
bind L source-file ~/.tmux/linux.session
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# THEME
set -g status-bg black
@rogeruiz
rogeruiz / frontEndTopicMeeting120426.markdown
Created April 26, 2012 13:43
Weekly Front End Topic Meeting - Compass / Sass Meetup Overview

Compass / Sass Meetup Overview

  • Sass 3.2 Is very close to shipping
  • thesassway.com blog
  • 1st Sass Conf in the Mid-Fall
    • It's only in the planning stage
    • They're still looking for sponsors
    • It may be free, but if it isn't all proceeds will go to a charity.
    • Any input is appreciated.
@rogeruiz
rogeruiz / _responsive.scss
Created May 1, 2012 16:15
Responsive Sass Function
// @name Responsive Function
// @desc A function that returns a percentage or ems for a rwd approach
// @param $target The target size
// @param $context The size of the parent of the target size
// @param [Optional] $t The type of calculation (defaults to percent)
// @author Roger Steve Ruiz
// @email roger.ruiz@rokkan.com
@function r($target, $context, $t: percent) {
@if $t == 'percent' {
@rogeruiz
rogeruiz / config.rb
Created May 14, 2012 19:51
My Compass Config File
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):
@rogeruiz
rogeruiz / haml_watch.rb
Created May 17, 2012 17:32
Let's watch some Haml
require 'rubygems'
require 'fssm'
directory = File.join(File.dirname(__FILE__), ARGV.first)
FSSM.monitor(directory, '**/*.haml') do
update do |base, relative|
input = "#{base}/#{relative}"
output = "#{base}/#{relative.gsub!('.haml', '.html')}"
command = "haml #{input} #{output}"
%x{#{command}}
@rogeruiz
rogeruiz / jquery.plugin.boilerplate.js
Created May 22, 2012 15:21
jQuery Plugin Boilerplate
(function($){
// private methods
var _<#privateMethodName#> = function(){};
// public methods
var methods = {
init: function(options){
if (this.hasInitialized){ return; }
@rogeruiz
rogeruiz / exampleMixins.scss
Created May 25, 2012 18:03
Examples of a Mixin with Ampersands
@mixin augmented-inner-mixin($augmentedClassName: arnold, $nestedClassName: foo) {
&.#{$augmentedClassName} { //div.matt
margin: 0 auto
.#{$nestedClassName} {
padding: 100px;
}
}
}
div {
@include augmented-inner-mixin(matt);
@rogeruiz
rogeruiz / mixin-versus-extend.scss
Created May 30, 2012 16:30
Mixins Versus Extends
.container {
width: 100px;
}
%inner {
font-family: Arial;
}
$fox-types: red, blue, green;
@rogeruiz
rogeruiz / gist:2853250
Created June 1, 2012 16:10 — forked from danapplegate/gist:2853235
MySQL insert using double list comprehension
def reward_close(data):
fields = ['id','name','image_url','hint','message','type','allow_duplicates','active']
print "Processing %i rewards" % len(data)
c.executemany( """INSERT INTO `ford_post_season`.`bv_rewards` (`%s`) VALUES (%s)""" % ('`, `'.join(fields), ', '.join(['%s'] * len(fields))),
[[reward[field].encode('utf-8') if hasattr(reward[field], 'encode') else reward[field] for field in fields] for reward in data])
@rogeruiz
rogeruiz / countries.html
Created July 11, 2012 18:29
List of Countries.
<option value='United States of America'>United States of America</option>
<option value='Afghanistan'>Afghanistan</option>
<option value='Akrotiri'>Akrotiri</option>
<option value='Albania'>Albania</option>
<option value='Algeria'>Algeria</option>
<option value='American Samoa'>American Samoa</option>
<option value='Andorra'>Andorra</option>
<option value='Angola'>Angola</option>
<option value='Anguilla'>Anguilla</option>
<option value='Antarctica'>Antarctica</option>