Skip to content

Instantly share code, notes, and snippets.

View felipesabino's full-sized avatar
👨‍💻

Felipe Sabino felipesabino

👨‍💻
View GitHub Profile
@iloveitaly
iloveitaly / vpn-utilities.applescript
Created July 3, 2010 19:05
Configure / create VPN connections via applescript
-- Author: Michael Bianco <http://mabblog.com/>
-- Some help from: http://discussions.info.apple.com/message.jspa?messageID=10363317
on create_vpn_service(vpn_name)
tell application "System Preferences"
reveal pane "Network"
activate
tell application "System Events"
tell process "System Preferences"
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@zwaldowski
zwaldowski / NSObject+Blocks.h
Created May 4, 2011 12:08
Perform blocks with delays and cancellation
//
// NSObject+Blocks.h
// Filemator
//
// Created by Zachary Waldowski on 4/12/11.
// Copyright 2011 Dizzy Technology. All rights reserved.
//
@interface NSObject (Blocks)
class ApplicationController < ActionController::Base
...
# FORCE to implement content_for in controller
def view_context
super.tap do |view|
(@_content_for || {}).each do |name,content|
view.content_for name, content
end
end
end
@robertmilne
robertmilne / ProfiledSql2008ClientDriver.cs
Created July 27, 2011 19:20
MiniProfiler: NHibernate profiling with batching support
using System.Data;
using System.Data.Common;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
using MvcMiniProfiler;
using MvcMiniProfiler.Data;
using NHibernate.Driver;
namespace YourNamespaceHere
{
@bentruyman
bentruyman / Custom.css
Created August 22, 2011 19:35
Tomorrow Theme for Chrome Developer Tools
/**********************************************/
/*
/* Tomorrow Skin by Ben Truyman - 2011
/*
/* Based on Chris Kempson's Tomorrow Theme:
/* https://github.com/ChrisKempson/Tomorrow-Theme
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@markalanevans
markalanevans / redis-init-rhel
Created November 3, 2011 03:22
Simple RedHat Redis init.d script
#!/bin/sh
#
# redis Startup script for Redis Server
#
# chkconfig: - 90 10
# description: Redis is an open source, advanced key-value store.
#
# processname: redis-server
# config: /etc/redis.conf
# pidfile: /var/run/redis.pid
@fractastical
fractastical / barrel_bookmarklet.js
Created November 3, 2011 22:31 — forked from bengl/barrel_bookmarklet.js
A bookmarklet to replicate Google's "do a barrel roll" on any arbitrary page.
javascript:(function(a,k,t,n,u,i,m,o,w){document.head.innerHTML+=['<style>@-',m,k,m,t,'@-',o,k,o,t,'@-',w,k,w,t,'body{-',m,a,n,m,a,u,m,a,i,'-',o,a,n,o,a,u,o,a,i,'-',w,a,n,w,a,u,w,a,i,'}</style>'].join('');})("-animation","-keyframes roll { 100% { -","-transform:rotate(360deg); } }","-name:roll;-","-duration:4s;-","-iteration-count:1;","moz",'o','webkit');
@jaigouk
jaigouk / Gemfile
Created November 16, 2011 15:40
How to use apigee with koala
# facebook library for Ruby, supporting the Graph API (including the batch requests and photo uploads), the REST API, realtime updates, test users, and OAuth validation
gem 'koala', :git => 'git@github.com:jaigouk/koala.git'