Skip to content

Instantly share code, notes, and snippets.

@brendano
brendano / autolog.py
Created October 10, 2008 23:00
python decorators to log all method calls, show call graphs in realtime too
# Written by Brendan O'Connor, brenocon@gmail.com, www.anyall.org
# * Originally written Aug. 2005
# * Posted to gist.github.com/16173 on Oct. 2008
# Copyright (c) 2003-2006 Open Source Applications Foundation
#
# Licensed 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
#
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active April 11, 2024 05:28 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@creaktive
creaktive / cpux86.js
Created May 18, 2011 13:07
Javascript PC Emulator by Fabrice Bellard
/*
PC Emulator
Copyright (c) 2011 Fabrice Bellard
Redistribution or commercial use is prohibited without the author's
permission.
*/
"use strict";
var aa;
@dmcg
dmcg / Examples.scala
Created June 10, 2011 14:22
GivenWhenThenFeatureSpec
class LoginFeature extends GivenWhenThenFeatureSpec with ShouldMatchers with OneInstancePerTest {
feature("Admin Login") {
scenario("Incorrect password") {
// You can provide the code for a step in a block
given("user visits", the[AdminHomePage]) {
startPage(pageClass)
}
@Alquimista
Alquimista / bezdraw.py
Created October 9, 2011 20:45 — forked from jl2/bezdraw.py
Draw Bezier curves using Python and PyQt
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import math
from PyQt4 import QtGui, QtCore
def binomial(i, n):
@mumoshu
mumoshu / various-accumulation-examples.scala
Created December 10, 2011 05:54
Various accumulation examples in Scala
/** まず、import, case class, val nodeseqのところまで
* REPLの:pasteコマンドでコピペして、各Exampleも同様にコピペして実行してみてね!
*
* Use :paste command in Scala REPL to run example code.
*/
import xml._
case class ColorPair(foregroundOption: Option[String], backgroundOption: Option[String])
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ypresto
ypresto / prepare-gentoo-prefix-macosx.sh
Created March 21, 2012 07:40
Gentoo prefix installation on Mac OS X
#!/usr/bin/bash
# Gentoo prefix installation on Mac OS X (Mar. 2012)
# This script may be outdated soon.
# Please refer: http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml
export EPREFIX="$HOME/gentoo"
export PATH="$EPREFIX/usr/bin:$EPREFIX/bin:$EPREFIX/tmp/usr/bin:$EPREFIX/tmp/bin:$PATH"
curl -o bootstrap-prefix.sh 'http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/bootstrap-prefix.sh?format=txt'
@rweald
rweald / build.sbt
Created March 24, 2012 18:22 — forked from mumoshu/build.sbt
DES and AES encryption in Scala
name := "DES and AES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"
@darktable
darktable / ProjectAssetPostprocessor.cs
Created April 20, 2012 03:37 — forked from hoesing/ProjectAssetPostprocessor.cs
Unity asset pre/postprocessor for applying asset defaults by path.
// Drop this script in the Editor directory in your project (creating the Editor directory if it's not there yet)
// Then re-import the assets in the directories covered by this script (right click and reimport)
//
// I would replace my path checking with the path checking from this gist:
// https://gist.github.com/1842177
//
// The texture settings for icons might want to use some of his settings combined with mine as well
using UnityEngine;