Skip to content

Instantly share code, notes, and snippets.

View michalstocki's full-sized avatar

Michał Stocki michalstocki

View GitHub Profile
@kminiatures
kminiatures / gist:df34f50e390b80f51a4c
Created May 23, 2014 02:01
bitbucket pull-request POST hook to Slack chat
<?
function hash_value($obj, $keys){
if(empty($keys)) return $obj;
$key = array_shift($keys);
if(isset($obj[$key])){
return hash_value($obj[$key], $keys);
}else{
return '';
}
}
/**
* User Timing polyfill (http://www.w3.org/TR/user-timing/)
* @author RubaXa <trash@rubaxa.org>
*/
(function (window){
var
startOffset = Date.now ? Date.now() : +(new Date)
, performance = window.performance || {}
, _entries = []
@jonathandixon
jonathandixon / Grunt-Cordova-CLI.md
Last active January 5, 2021 22:00
Using Grunt with a Cordova 3 project.

Grunt and Cordova 3

The advantages of using Grunt with Cordova:

  1. It simplifies working with the cordova cli.
  2. It provides a mechanism to copy platform customization to the platforms directory without having to commit the generated plugins and platforms directories to version control.
  3. It provides a way to watch resources and automatically run cordova commands.

Stack Overflow: .gitignore for PhoneGap/Cordova 3.0 projects - what should I commit?

@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Grawl
Grawl / prefix-free.styl
Created February 4, 2012 08:29 — forked from sapegin/gist:1735915
-prefix-free for Stylus
// #### it's compilable -prefix-free
// © 2011 Artem Sapegin http://sapegin.ru
// + 2011 Grawl http://grawl.ru
// + radial-gradient and other rules with vendor prefixes added by Grawl.
// add your fixes to My table of vendor prefixes there: http://goo.gl/3hPfR
/* mask:
parameter()
-webkit-parameter arguments
-moz-parameter arguments
-ms-parameter arguments
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@drewbourne
drewbourne / CreateMockolatesManually.as
Created June 21, 2011 03:30
Mockolate FlexUnit Setup Examples
package example
{
import flash.events.Event;
import mockolate.mock;
import mockolate.nice;
import mockolate.prepare;
import org.flexunit.assertThat;
import org.flexunit.async.Async;
@unruthless
unruthless / CSS for <sup> and <sub>
Created May 26, 2010 01:31
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@jeffrafter
jeffrafter / handler.js
Created April 2, 2010 20:59
Simple HTTP Server and Router in node.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}