Skip to content

Instantly share code, notes, and snippets.

View loisaidasam's full-sized avatar
🙌
🙌

Loisaida Sam loisaidasam

🙌
🙌
View GitHub Profile
@jdp
jdp / example.php
Created May 19, 2009 08:26
Glue API implementation
<?php
// require glue lib
require 'glue.php';
// create a glue object, and look up the neverending story in json format
// $glue->$method->$chain maps to api calls, like method/chain
// you can use any value, but glue will throw errors
$glue = new Glue('username', 'password');
$response = $glue->object->get(array(
'objectId' => 'http://en.wikipedia.org/wiki/The_Neverending_Story',
@jdp
jdp / magneton.php
Created July 9, 2009 11:38
Magneton, the superdense PHP framework
<?php $u=$_GET['u'];$l=$u();extract($l);include("view/{$u}.php");
@unbracketed
unbracketed / gist:228457
Created November 7, 2009 01:45
Django virtualenv postactivate hook
#I usually drop something like this into my virtualenv's postactivate for some
#quick and handy shortcuts to common Django commands.
#This way dropping in to do some work on any arbitrary project is as easy as:
# 1. workon <project name>
# 2. djr
cd /path/to/site/root
#Django command shortcuts
alias dj='python manage.py'
@0xRoch
0xRoch / gist:874131
Created March 17, 2011 10:30
How to invalidate CloudFront files using Python
import boto
cf = boto.connect_cloudfront('key1', 'key2')
cf.create_invalidation_request("distribution_id", ["/path1","/path2"])
@torsten
torsten / svn-stats.sh
Created April 21, 2011 09:05
Prints a list of all committers in a subversion repository, sorted by number of commits.
#!/bin/bash
# Prints a list of all committers in a subversion repository,
# sorted by number of commits.
# Written by Torsten Becker <torsten.becker@gmail.com> in 2011
if [[ ! $1 ]]; then
echo "Usage: $0 SVN-REPO-URL"
exit 1
fi
@voldmar
voldmar / signals.py
Last active April 25, 2024 15:32
Show all signals receivers in Django project (quickfixed to work with Django 1.10)
# coding:utf-8
from sys import modules
import gc
import inspect
import six
from django.core.management.base import BaseCommand
from django.dispatch.dispatcher import Signal, WeakMethod
@david-torres
david-torres / diffbot.py
Created November 3, 2011 18:13
Simple Python interface for Diffbot API
import requests
import json
class Diffbot(object):
"""
A simple Python interface for the Diffbot api.
Relies on the Requests library - python-requests.org
Usage:
@bartoszmajsak
bartoszmajsak / prepare-commit-msg.sh
Last active March 20, 2024 08:12
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
~$ git clone -b release-4.12 git://github.com/echonest/echoprint-codegen.git
Cloning into 'echoprint-codegen'...
remote: Counting objects: 665, done.
remote: Compressing objects: 100% (280/280), done.
remote: Total 665 (delta 428), reused 612 (delta 376)
Receiving objects: 100% (665/665), 1.40 MiB | 578 KiB/s, done.
Resolving deltas: 100% (428/428), done.
~$ cd echoprint-codegen/
~/echoprint-codegen$ cd src/
~/echoprint-codegen/src$ vi Makefile # edit BOOST_CFLAGS and other variables as necessary
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string