Skip to content

Instantly share code, notes, and snippets.

View urosgruber's full-sized avatar
🐢

Uros Gruber urosgruber

🐢
  • Squarebox
  • Slovenia
View GitHub Profile
@urosgruber
urosgruber / post-receive
Created April 5, 2012 20:17
git post receive hook
#!/bin/bash -x
#
# An example hook script for the post-receive event
#
# This script is run after receive-pack has accepted a pack and the
# repository has been updated. It is passed arguments in through stdin
# in the form
# <oldrev> <newrev> <refname>
# For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@urosgruber
urosgruber / gist:2660665
Created May 11, 2012 16:06 — forked from cameronmcefee/gist:2641743
Font Configuration File
# Font Squirrel Font-face Generator Configuration File
# Upload this file to the generator to recreate the settings
# you used to create these fonts.
{"mode":"expert","formats":["ttf","woff","eot","svg"],"tt_instructor":"default","options_subset":"advanced","subset_custom":"","subset_custom_range":"f000-f073,f200-f273","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0","rememberme":"Y"}
@urosgruber
urosgruber / gist:2669367
Created May 12, 2012 22:06
Slim middleware
<?php
namespace SB\Middleware;
class JsonDecode extends \Slim_Middleware {
public function __construct() {
}
@urosgruber
urosgruber / gist:2687106
Created May 13, 2012 09:13
Creating a Backbone.js View Manager
/**
Big thanks to Derick Bailey for his post here:
http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/
*/
(function(Account) {
/** LOTS OF MODEL, COLLECTION, AND VIEW CREATION GOING ON UP HERE, LEFT IT OUT FOR SIMPLICITY */
/**
* Define Routing.
@urosgruber
urosgruber / formserialization.coffee
Created June 12, 2012 22:15 — forked from ajacksified/formserialization.coffee
Coffeescript / Underscore form serialization
serializeForm: (selector) ->
return _.reduce($(selector).serializeArray(), (memo, v) ->
memo[v.name] = v.value
memo
, {});
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@urosgruber
urosgruber / mountain-lion-brew-setup.markdown
Created July 27, 2012 07:15 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@urosgruber
urosgruber / ML, Python and virtualenv.md
Created July 27, 2012 07:15 — forked from thesharp/ML, Python and virtualenv.md
Quick virtualenv fix on Mountain Lion

Quick virtualenv fix on Mountain Lion

Overview

It appears that Apple somehow broke Python in Mountain Lion, so even with the latest Command Line Tools and Xcode 4.4 virtualenv won't properly work. During virtual environment creation it will try to install easy_install inside /Library hierarchy. So let's give it a quick workaround. Let's install custom python into your $HOME-directory using pythonbrew!

Installing proper Command Line Tools

Without the Apple Mac Developer account you won't even see the proper download link for the latest CL Tools and the old one won't work on ML. So here's the link: http://goo.gl/iBTXh. It points towards the Apple website so don't worry.

@urosgruber
urosgruber / gist:3331477
Created August 12, 2012 11:28
Doctrine cli config
<?php
// cli-config.php
use Doctrine\Common\ClassLoader,
Doctrine\ORM\EntityManager,
Doctrine\ORM\Tools\Setup;
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));