Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
@scottbw
scottbw / jquery.oauth.js
Created November 6, 2011 00:23 — forked from andyedinborough/jquery.oauth.js
Introduces $.oauth() to make using OAuth from jQuery as easy as using $.ajax()
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
anonymous
anonymous / bootstrap-typeahead-backbone.js
Created February 5, 2012 13:36
bootstrap typeahead with backbone
/* =============================================================
* bootstrap-typeahead-backbone.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js
* Modified by Marius Andreiana to work with Backbone Collection, Model, View
* - custom results formatting
* - custom behavior on selected item (Model with complex information)
* =============================================================
* Copyright 2012 Twitter, Inc.
*
def run_pg_fouine():
info = host_info[env.host_string]
db_name = info.tags.get('Name')
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
time.sleep(30)
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt')
run('gzip -f /tmp/pgfouine.txt')
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@wickman
wickman / README.md
Created April 12, 2012 22:55
Python development in Pants (tutorial)

Python development using Pants

brian wickman - @wickman

[TOC]

Why use Pants for Python development?

Pants makes the manipulation and distribution of hermetically sealed Python environments

@Raynos
Raynos / x.md
Created April 12, 2012 22:57
JavaScript tools

RE: State of the Art

There was a recent article on [State of the Art JavaScript][1]. It's fully of dated / wrong recommendations.

Let's see what he is recommending:

JavaScript

JavaScript is awesome and state of the art ;)

@GuillaumeBiton
GuillaumeBiton / README.txt
Created August 10, 2012 16:43
Simple binding between Bootstrap typeahead and Backbone collection
Simple example on how to make Twitter Bootstrap typeahead working with backbone collections.
Usage :
var bui = new Bootstrap.Typeahead({
collection: ?
property: ?
items: ?
...
});
@jmaupetit
jmaupetit / ghost_capture_pdf.py
Created December 5, 2012 17:57
Ghost.py capture to PDF
from ghost import Ghost
from PySide.QtGui import QApplication, QImage, QPainter, QPrinter
class MyGhost(Ghost):
def capture_pdf(self):
printer = QPrinter(QPrinter.HighResolution)
printer.setResolution(300)
printer.setOutputFileName("QtPrinter.pdf")
printer.setPaperSize(QPrinter.A4)
#!/usr/bin/python
#
# List all files that have ever been committed in this repository, in any
# commit in any branch.
import pygit2
import stat
def list_all_files(repo_path):
repo = pygit2.Repository(repo_path)