Skip to content

Instantly share code, notes, and snippets.

@hraban
hraban / pre-commit.md
Last active April 18, 2024 06:46
Prevent accidentally committing debug code in Git
@Natim
Natim / ini2json.py
Created January 11, 2013 10:21
Convert an ini configuration file into a json file
# -*- coding: utf-8 -*-
import json
import sys
from ConfigParser import (ConfigParser, MissingSectionHeaderError,
ParsingError, DEFAULTSECT)
class StrictConfigParser(ConfigParser):
def _read(self, fp, fpname):
@hraban
hraban / gist:3017681
Last active August 15, 2016 12:25
My .emacs (hraban)
(add-to-list 'load-path "~/.emacs.d/plugins")
;; cl-* functions and macros
(require 'cl)
(cl-defmacro if-exists ((var fname) &rest body)
`(let ((,var ,fname))
(when (file-exists-p ,var)
,@body)))
@kerorotg
kerorotg / gist:1886569
Created February 22, 2012 18:39 — forked from ttilley/gist:1737625
mac sandbox and code signing conveniences
//
// CodeSignConveniences.h
//
// Created by Travis Tilley on 2/4/12.
// Copyright (c) 2012 Travis Tilley. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Security/CodeSigning.h>
@keithamus
keithamus / Nano Git Commit Syntax highlighting
Created December 10, 2010 13:58
Add this to your ~/.nanorc and when running "git commit" (if your editor is nano) you'll have syntax highlighting in your commit message. Includes support for "git commit -v" too!
syntax "gitcommit" "COMMIT_EDITMSG$"
color white "#.*"
color green "#.(modified|deleted).*"
color yellow start="# Changes.*" end="# Changed.*"
color cyan start="# Untracked.*" end="diff"
color cyan start="# Untracked.*" end="$$"
color brightred "^deleted file mode .*"
color brightgreen "^\+.*"
color brightred "^-.*"
color brightyellow "^(diff|index|---|\+\+\+).*"