Skip to content

Instantly share code, notes, and snippets.

View martincr's full-sized avatar

martincr martincr

View GitHub Profile
@martincr
martincr / gist:7028087483694567c606
Created January 10, 2015 03:29
cleanout-rvm.sh
#!/bin/bash
/usr/bin/sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm
/usr/bin/sudo /usr/sbin/groupdel rvm
/bin/echo "RVM is removed. Please check all .bashrc|.bash_profile|.profile|.zshrc for RVM source lines and delete
or comment out if this was a Per-User installation."
@martincr
martincr / gist:9fef9e4b4d1caf5e3ec4
Last active August 29, 2015 14:13
ST3 subl bash shortcut
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl
# Works with OS X 10.9(.5) Mavericks
@martincr
martincr / gist:f5d6636b66c484e28510
Last active August 29, 2015 14:13
.bash_profile
# .bash_profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"AddPerm",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::example.com/*"
]
}
@martincr
martincr / gist:f1b59e7b68232817b2c9
Last active August 29, 2015 14:01
Third-party Jekyll importer for Jekyll
ruby blogspot_to_jekyll.rb http://{blogspot}/feeds/posts/default?max-results=300 --verbose
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@martincr
martincr / gist:8463613
Created January 16, 2014 21:17
PostgreSQL Cheat Sheet
PostgreSQL Cheat Sheet
======================
CREATE DATABASE
CREATE DATABASE dbName;
CREATE TABLE (with auto numbering integer id)
CREATE TABLE tableName (
id serial PRIMARY KEY,
name varchar(50) UNIQUE NOT NULL,
NSArray *foods = @[@"tacos", @"burgers"];
NSLog(@"%@", (*foods description);
@martincr
martincr / gist:5500012
Last active December 16, 2015 21:29
Links for tips on setting up Sublime Text 2.
@martincr
martincr / gist:a9ccfff96ba3285a684e
Last active December 16, 2015 10:39
Preferences.sublime-settings
{
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",