Skip to content

Instantly share code, notes, and snippets.

View kotnik's full-sized avatar

Nikola Kotur kotnik

View GitHub Profile
@kotnik
kotnik / pastebin.sh
Last active August 26, 2015 10:17 — forked from ralt/pastebin.sh
putfile & pastebin
#!/bin/bash
file=$(mktemp ~/Documents/Pastes/XXXXXX)
mv $file $file.html
file="$file.html"
chmod 644 ${file}
[[ ! -z "$1" ]] && lang="-s $1"
cat - > ${file}.in
@kotnik
kotnik / print_pkg_deps.py
Created May 7, 2014 07:48 — forked from mtayseer/print_pkg_deps.py
Print a list of installed packages and their dependencies
import pkg_resources
for pkg in pkg_resources.working_set:
if pkg.requires():
print '{} => {}'.format(pkg.key, ', '.join(req.project_name for req in pkg.requires()))
else:
print pkg.key
@kotnik
kotnik / project.make
Last active August 29, 2015 13:57 — forked from perusio/project.make
; -*-conf-*-
api = 2
core = 7.x
; Commerce kickstart.
projects[commerce_kickstart][type] = core
; Be2Bill needed modules.
projects[commerce_cardonfile] = "2.0-beta2"
projects[commerce_be2bill] = "1.x-dev"
@kotnik
kotnik / fabfile.py
Created July 19, 2013 13:40 — forked from joshkehn/fabfile.py
Update all packages with Fabric calling pip.
from fabric.api import local
import pip
def freeze ():
local("pip freeze > requirements.txt")
local("git add requirements.txt")
local("git commit -v")
def upgrade ():
for dist in pip.get_installed_distributions():
@kotnik
kotnik / pre-commit.sh
Last active December 15, 2015 19:28 — forked from mxgrn/gist:663933
Trailing whitespace removal git commit hook.
#!/bin/sh
#
# This will abort "git commit" and remove the trailing whitespaces from the files to be committed.
# Simply repeating the last "git commit" command will do the commit then.
#
# Put this into .git/hooks/pre-commit, and chmod +x it.
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
@kotnik
kotnik / pr.md
Created March 25, 2013 12:59 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@kotnik
kotnik / gist:1986671
Created March 6, 2012 14:54 — forked from voxpelli/gist:1069596
OAuth Connector setup for OAuth Login provider
<?php
$provider = new stdClass;
$provider->disabled = FALSE; /* Edit this to true to make a default provider disabled initially */
$provider->name = 'sso1';
$provider->title = 'sso1';
$provider->url = 'http://sso1.loc/';
$provider->consumer_advanced = array(
'signature method' => 'HMAC-SHA512',
'request token endpoint' => '/oauth/request_token',
'authorization endpoint' => '/oauth/authorize',
@kotnik
kotnik / gist:1183650
Created August 31, 2011 14:18 — forked from ngmaloney/gist:981766
my.drush.inc
<?php
/**
* @file My Drush Commands
*/
/**
* Implementation of hook_drush_help()
*/
function my_drush_help($section) {
switch ($section) {