Skip to content

Instantly share code, notes, and snippets.

View zeropaper's full-sized avatar
💅
I may be slow to respond.

Valentin Vago zeropaper

💅
I may be slow to respond.
View GitHub Profile
@zeropaper
zeropaper / camunda-webapp.sublime-project
Last active August 29, 2015 14:03
SublimeText project for working on camunda BPM webapp (clone the repositories in the same folder as this file)
{
"folders":
[
{
"name": "SDK",
"path": "camunda-bpm-sdk-js",
"folder_exclude_patterns": [
"dist",
"example",
"doc",
@zeropaper
zeropaper / asyncSeries
Created September 9, 2014 10:53
the async.series function, unleashed
// borrowed from async.js because I dislike promises (very much)
// https://github.com/caolan/async/blob/master/lib/async.js
function _eachSeries(arr, iterator, callback) {
callback = callback || function () {};
if (!arr.length) {
return callback();
}
var completed = 0;
var iterate = function () {
@zeropaper
zeropaper / ie-detection.js
Created October 27, 2014 13:03
The sales guys at MS pretend it's not needed anymore they probably never wrote a line of CSS... :(
// Inspired by http://jsfiddle.net/evildonald/jLuF5/
function detectIE() {
var $ = window.$ || window.jQuery || angular.element;
var s = document.body.style;
var version;
if (s.msTextCombineHorizontal !== undefined) {
version = 11;
}
else if (s.msFlexOrder !== undefined) {
// $Id$
//
jQuery UI screen structure and presentation
This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI
Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
Visit themeroller.com
@import compass/utilities/general/reset.sass
@import compass/utilities/general/float.sass
@zeropaper
zeropaper / CSS3-Smilies.html
Created December 14, 2010 14:07
CSS3-Smilies
<style type="text/css">
.smiley {
background-color: rgb(0, 0, 0);
color: rgb(255, 255, 255);
display: inline-block;
width: 16px;
height: 16px;
line-height: 16px;
font-size: 12px;
text-align: center;
@zeropaper
zeropaper / YOURMODULENAME.module.php
Created September 27, 2011 11:10
A simple theming function override to display the generated .info file for the features module
<?php
/**
* Implements hook_theme_registry_alter()
*/
function YOURMODULENAME_theme_registry_alter(&$items) {
$items['features_components']['function'] = 'YOURMODULENAME_features_components';
}
@zeropaper
zeropaper / small-dialog-example.js
Created December 2, 2011 13:58
A tiny piece of JS to handle dialogs
(function($){
var C = typeof console == 'object' ? console : {info: function(){}, log: function(){}, error: function(){}};
var searchSettings = {
id: 'search-dialog',
el: $('#top-menu .search')[0],
keepClosed: true,
type: 'search',
content: $('#js-page-search-form').html(),
outerWidth: $tm.outerWidth(),
@zeropaper
zeropaper / sync.js
Created June 4, 2013 06:08
Very very simple "sync" for Backbone & Redis
/*jslint indent: 2, node: true*/
'use strict';
var _ = require('underscore');
var redis = require('redis');
module.exports = function(options) {
options = _.clone(options || {});
_.defaults(options, {
port: 6379,
host: '127.0.0.1',
options: {},
@zeropaper
zeropaper / gist:5775266
Last active December 18, 2015 11:20
just a little utility to test some webservice
var http = require('http');
var host = 'test.domain.com';
var apiUrl = 'http://'+ host +'/api/v1';
var URI = require('URIjs');
var async = require('async');
var _ = require('underscore');
var cookies = {};
@zeropaper
zeropaper / console.js
Created July 23, 2013 10:06
Ensure a console object with the following methods: - info - log - error - debug - trace - group - groupEnd - warn
var console = {};
var methods = 'info log error debug trace group groupEnd warn'.split(' ');
for (var m in methods) {
if (typeof console[methods[m]] !== 'function') {
console[methods[m]] = function(){};
}
}
window.console = console;