Skip to content

Instantly share code, notes, and snippets.

View andresgutgon's full-sized avatar
:octocat:
Coding things...

Andrés andresgutgon

:octocat:
Coding things...
  • Barcelona
View GitHub Profile
@andresgutgon
andresgutgon / dosbatch.sublime-build
Created October 29, 2012 15:12 — forked from mmuell/dosbatch.sublime-build
Batch File Running for Sublime Text 2
{
"cmd": ["$file"],
"working_dir": "$file_path",
"selector": "source.dosbatch"
}
@andresgutgon
andresgutgon / 1_slower_sprite_file.scss
Created October 18, 2012 11:06 — forked from chriseppstein/1_slower_sprite_file.scss
This gist demonstrates how a generated sprite file can be optimized to shave some time off your compile.
@import "compass/utilities/sprites/base";
// General Sprite Defaults
// You can override them before you import this file.
$emblem-sprite-base-class: ".emblem-sprite" !default;
$emblem-sprite-dimensions: false !default;
$emblem-position: 0% !default;
$emblem-spacing: 0 !default;
$emblem-repeat: no-repeat !default;
@andresgutgon
andresgutgon / ipdb.sublime-snippet
Created October 12, 2012 12:56 — forked from jorgebastida/ipdb.sublime-snippet
Sublime text 2 ipdb snippet - import ipdb; ipdb.set.trace()
<snippet>
<content><![CDATA[import ipdb; ipdb.set_trace()]]></content>
<tabTrigger>ipdb</tabTrigger>
<scope>source.python</scope>
<description>ipdb</description>
</snippet>
@andresgutgon
andresgutgon / character_reference.rb
Created May 2, 2012 16:18 — forked from norman/character_reference.rb
HTML entities? We don't need no stinkin' HTML entities.
# coding: utf-8
#
# Encode any codepoint outside the ASCII printable range to an HTML character
# reference (http://bit.ly/KNupLT).
def encode(string)
string.each_codepoint.inject("") do |buffer, cp|
cp = "&#x#{cp.to_s(16)};" unless cp >= 0x20 && cp <= 0x7E
buffer << cp
end
end
@andresgutgon
andresgutgon / easy_tunnel.rake
Created April 29, 2012 12:03 — forked from waseem/easy_tunnel.rake
A Rake interface to creating a tunnel using ssh.
##
# A Rake interface to creating a tunnel using ssh.
# This file originally comes with the facebooker gem for Ruby on Rails: http://github.com/mmangino/facebooker
#
# How to use:
# 1. Simply put it at a proper place. e.g. lib/tasks/ in your Rails application
# 2. Create a config file 'easy_tunnel.yml' like following:
#
# development:
# public_host_username: host_user_name
@andresgutgon
andresgutgon / index.js.erb
Created December 17, 2011 14:39 — forked from ryanb/index.js.erb
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>