Skip to content

Instantly share code, notes, and snippets.

View doodyparizada's full-sized avatar

Doody Parizada doodyparizada

View GitHub Profile
@doodyparizada
doodyparizada / prepare-commit-msg
Created August 5, 2014 07:30
a python script for prepare-commit-msg that extracts the branch name and inserts it as the first word of the commit message title
#!/usr/bin/python
import commands
import sys
import fileinput
def get_task_name(branch):
task = branch.rsplit("/",1)[-1]
task = task.split("_")[0]
if task.count('-') > 1:
@doodyparizada
doodyparizada / try_catch.m
Created December 4, 2014 10:00
try-catch on dictionary value for key
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool {
NSDictionary *dict = @{
@"Doody" : @"Doody",
};
@try {
[ dict valueForKeyPath:@"Doody.Doody.Doody" ];
@doodyparizada
doodyparizada / config.cfg
Last active October 22, 2015 06:46
expand environment variables from given stdin
a = "$GOPATH"
b = "$LANG"
c = "$NO_SUCH_ENVAR"
@doodyparizada
doodyparizada / couchbase_export_views.py
Last active March 21, 2016 13:33 — forked from lord-otori/couchbase_export_views.php
A script to export all views in a Couchbase server to files.
#!/usr/bin/env python
import requests
import sys
from collections import namedtuple
Bucket = namedtuple('Bucket', ('name', 'type', 'ddocs_uri'))
View = namedtuple('View', ('name', 'map', 'reduce'))
DDoc = namedtuple('DDoc', ('name', 'views'))