Skip to content

Instantly share code, notes, and snippets.

View anoxic's full-sized avatar
🐙
working on it all at once

Bad Sir Brian anoxic

🐙
working on it all at once
View GitHub Profile
@scelis
scelis / chpwd_update_git_vars.sh
Created November 27, 2009 20:16
Add git information to your ZSH prompt.
update_current_git_vars
@jessegreathouse
jessegreathouse / fig1-1_MagicMethodsBefore.php
Created May 6, 2011 14:34
Before and After Magic Methods in entities. What originally I tried to do was using __get and __set but the implementation of that made my entities properties virtually public, which was something that's a no no with doctrine. So instead of using __get __
<?php
/** @MappedSuperclass */
class MagicMethods
{
public function __get($name) {
return $this->{strtolower($name)};
}
public function __set($name, $value)
@hinzundcode
hinzundcode / leet.php
Created July 9, 2011 11:26
Leetspeak Generator
<?php
header('Content-type: text/plain; charset=utf8');
$input = "hab me eben nen leet-speak generator geschrieben..";
$words = array(
'one' => 1,
'to' => 2,
'too' => 2,
<?php
class SaltedHash {
protected $salt;
protected $active_hash;
const SALT_LENGTH = 15;
function __construct($hash=null) {
$this->active_hash = $hash;
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@davelab6
davelab6 / fontforge-features.txt
Created July 20, 2012 11:28
FontForge Feature List
[IN PROGRESS - J HANNA] Mac Feature: Make transparent PNG icons in menus not crash FontForge
Mac Feature: Apply all fixes in https://github.com/ummels/homebrew/commit/a68fd6b241306d563c3600403e6e7eb56abe0921 to the git master.
HUGE Feature: Make the Python object environment compatible with RoboFab.
Huge feature: add an automatic bug reporting tool that gets source code line number traces from a crash and submits them to a crash mailing list automatically
Big feature: Make key bindings interactive, so when the user clicks and holds on a menu item and the presses a key chord, that key chord is bound to that menu item, and stored in the current theme file
<?php
interface Context {
public function execute($params);
}
@Crash--
Crash-- / gist:4204272
Created December 4, 2012 14:08
Optimize ?
public function __get($key)
{
$func = array($this, 'get' . ucwords($key));
if (\is_callable($func)) {
return call_user_func($func);
}
}
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
@qbit
qbit / gist:5483415
Last active February 25, 2024 13:35
KSH support for git-prompt
# ksh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).