Skip to content

Instantly share code, notes, and snippets.

View croensch's full-sized avatar
🤠
out there

croensch

🤠
out there
  • Hella Gutmann Solutions
  • Freiburg im Breisgau, Germany
View GitHub Profile
@thenewbie
thenewbie / echo-server.php
Created November 21, 2009 10:58
PHP is UNIX - Simple preforking echo server in PHP
<?
/*
PHP is UNIX - Simple preforking echo server in PHP
**************************************************
The code here is related to:
http://tomayko.com/writings/unicorn-is-unix
http://jacobian.org/writing/python-is-unix/
http://plasmasturm.org/log/547/ - perl is unix
@snichme
snichme / gist:789589
Created January 21, 2011 12:05
A Doctrine logger for FireBug(FirePHP)
<?php
/**
* Doctrine logger for FireBug
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Magnus Andersson <mange@mange.name>
*/
namespace My\Namespace;
use Doctrine\DBAL\Logging\SqlLogger;
@alecgorge
alecgorge / java-properties.php
Created May 18, 2011 00:29
Parse Java properties files in PHP
<?php
function parse_properties($txtProperties) {
$result = array();
$lines = split("\n", $txtProperties);
$key = "";
$isWaitingOtherLine = false;
foreach ($lines as $i => $line) {
if (empty($line) || (!$isWaitingOtherLine && strpos($line, "#") === 0))
continue;
@gcoop
gcoop / qunit-runner.js
Created January 10, 2012 10:42
QUnit runner using PhantomJS.js
//
// Runs a folder of tests or a single test, using QUnit and outputs a JUnit xml file ready for sweet integration with your CI server.
//
// @usage
// DISPLAY=:0 phantomjs qunit-runner.js --qunit qunit.js --tests tests-foler/ --package package.json --junit qunit-results.xml
//
// package.json is a common JS package file which contains a list of files that need to be loaded before the tests are run. In this instance
// the package.json lists the files for a JS SDK, that gets loaded and then the tests test the SDK.
//
// Designed to run via PhantomJS.
@RupW
RupW / jquery.support.checkboxindeterminate.js
Created April 6, 2012 09:35
Detect HTML5 checkbox indeterminate support storing result in jQuery.support namespace
/**
* jQuery.support.checkboxIndeterminate
* https://github.com/RupW
* Tests for HTML 5 checkbox 'indeterminate' property
* http://www.w3.org/TR/html5/the-input-element.html#dom-input-indeterminate
* http://www.w3.org/TR/html5/number-state.html#checkbox-state
*
* Released under the same license as jQuery
* http://docs.jquery.com/License
*
@gcoop
gcoop / qunit.js
Created April 25, 2012 10:31
QUnit for use with the QUnit runner.
/**
* QUnit - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2011 John Resig, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* or GPL (GPL-LICENSE.txt) licenses.
*/
@andrewhavens
andrewhavens / Bootstrap.php
Created July 10, 2012 15:20
An example of a custom Zend Framework route that results in a 301 redirect
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initCustomRoutes()
{
$router = Zend_Controller_Front::getInstance()->getRouter();
$route = new Mylib_Controller_Router_Route_Redirect('old/route/*', array('controller'=>'content', 'action'=>'index'));
$router->addRoute('old_route', $route);
}
@valueof
valueof / notabs.js
Created October 13, 2012 18:12
A reporter that discards all warnings about mixed tabs and errors
/**
* notabs.js
*
* A reporter that discards all warnings about mixed tabs and errors.
* This file was based on our default reporter so output is the same.
*
* Usage:
* jshint myfile.js --reporter=notabs.js
*/
@myano
myano / index.md
Last active May 25, 2024 16:51
Merging forked gists into your gist to preserve the history of the gist.

Merging A Forked Gist Into Your Gist

Let's say you have a gist (public or private) and someone forks it and makes changes to it. Awesome! However, now you want to merge in their changes to your gist. Unfortunately, it doesn't seem GitHub supports this via their website at the moment, however, you can still merge the gists with 'git' on the command line.

  1. You want to clone your gist. You can locate the link for this under "Clone this gist"

     ➜  ~/dev » git clone https://gist.github.com/5315168.git
     Cloning into '5315168'...
    

remote: Counting objects: 6, done.

@mariomartinezsz
mariomartinezsz / install-couchdb-1.5.0.sh
Last active December 30, 2015 05:29
Install CouchDB 1.5.0 on Ubuntu Server (Tested with Ubuntu Server 12.04 LTS Precise Pangolin)
#!/bin/sh
# Based on http://jswiki.lab-01.com/wiki/doku.php?id=install-couch
echo "Downloading Linux build tools and Erlang"
sudo apt-get install build-essential libicu-dev libcurl4-gnutls-dev libtool erlang-dev erlang zip -y
# Work on tmp directory
cd /tmp
# Spidermonkey is required