This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example database from flyspray | |
* | |
* @author Bouke Haarsma <bouke@webatoom.nl> | |
*/ | |
mysql_connect("localhost", "(user)", "(pass)"); | |
mysql_select_db("(db)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ${ClassName} { | |
protected static $instance; | |
/** | |
* Returns an instance of this Singleton | |
* @return ${ClassName} | |
*/ | |
public static function getInstance() { | |
if(!isset(self::$instance)) { | |
self::$instance = new self(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Use this per example as a post-commit hook | |
git log -n 1 --pretty=%H | tr -d '\n' | xclip -sel clip | |
echo "\033[32mCopied commit-id to clipboard\033[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if GIT_PS1_SHOWDIRTYSTATE is set to a nonempty value, | |
# unstaged (*) and staged (+) changes will be shown next to the branch name | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
# if GIT_PS1_SHOWSTASHSTATE is set to a nonempty value, | |
# a ‘$’ will be shown next to the branch name if something is stashed | |
export GIT_PS1_SHOWSTASHSTATE=1 | |
# if GIT_PS1_SHOWUNTRACKEDFILES is set to a nonempty value, | |
# a ‘%’ will be shown next to the branch name if there’re untracked files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Define PROJECT_PATH as the project's root directory, according to new 1.4 layout: | |
# | |
# root | |
# |-- manage.py | |
# |-- project | |
# |-- settings.py | |
PROJECT_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import * | |
## hosts | |
@task | |
@hosts('a') | |
def first(): | |
execute(second) | |
@task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
import wx.grid | |
class Frame1(wx.Frame): | |
def __init__(self, parent): | |
wx.Frame.__init__(self, id=-1, name='', parent=None, | |
pos=wx.Point(100, 100), size=wx.Size(480, 250), | |
style=wx.DEFAULT_FRAME_STYLE, title='Spam & Eggs') | |
self.SetClientSize(wx.Size(400, 250)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
class DemoFrame(wx.Frame): | |
def __init__(self): | |
wx.Frame.__init__(self, None, wx.ID_ANY, "Somewhat Native OSX Toolbar", size=(700,400)) | |
self.toolbar = self.CreateToolBar(wx.TB_FLAT | wx.TB_TEXT) | |
self.toolbar.AddLabelTool(wx.ID_NEW, 'Label', wx.Bitmap('wrench.png')) | |
self.toolbar.AddCheckLabelTool(wx.ID_NEW, 'Check', wx.Bitmap('wrench.png')) | |
self.toolbar.AddRadioLabelTool(wx.ID_NEW, 'Radio 1', wx.Bitmap('wrench.png')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# je-eigen-ronde: http://ogp.me/ns/fb/je-eigen-ronde#"> | |
<title>OG Sample Object - Sample Track</title> | |
<meta property="og:type" content="game.achievement" /> | |
<meta property="og:title" content="Completed All Tracks!" /> | |
<meta property="fb:app_id" content="121286284698132" /> | |
<meta property="og:image" content="https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" /> | |
<meta property="og:url" content="https://gist.github.com/raw/4446602/fb.achievement.html" /> | |
<meta property="og:description" content="Marvelous achievement" /> | |
<meta property="game:points" content="50" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
tmp = ""; | |
for (var i=0; i<24; i++) { | |
tmp += String.fromCharCode((Math.random() * 94 | 0) + 33); | |
} | |
prompt("Your password", tmp); | |
})() |
OlderNewer