Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
<?php
/**
* On-the-fly CSS Compression
* Copyright (c) 2009 and onwards, Manas Tungare.
* Creative Commons Attribution, Share-Alike.
*
* In order to minimize the number and size of HTTP requests for CSS content,
* this script combines multiple CSS files into a single file and compresses
* it on-the-fly.
*
@zoxon
zoxon / json.php
Last active August 29, 2015 14:26 — forked from itspriddle/json.php
Pure PHP json library
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Converts to and from JSON format.
*
* JSON (JavaScript Object Notation) is a lightweight data-interchange
* format. It is easy for humans to read and write. It is easy for machines
* to parse and generate. It is based on a subset of the JavaScript
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
@zoxon
zoxon / howto-manually-add-trust-cert-to-rubygems.md
Created January 29, 2016 08:40
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller)

SSL upgrades on rubygems.org and RubyInstaller versions

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


Hello,

If you reached this page, means you've hit this SSL error when trying to

@zoxon
zoxon / .vimrc
Created September 5, 2016 04:00 — forked from millermedeiros/.vimrc
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory.
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
" -----------------------------------------------------------------------------
@zoxon
zoxon / shuffle_array.js
Created December 22, 2016 03:01 — forked from d-simon/shuffle_array.js
Shuffle Array
shuffle = function(v){
for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
return v;
};
@zoxon
zoxon / math_random.js
Created December 22, 2016 03:03 — forked from d-simon/math_random.js
Random number in range
/**
* Returns a random number between min and max
*/
function getRandomArbitary (min, max) {
return Math.random() * (max - min) + min;
}
/**
* Returns a random integer between min and max
* Using Math.round() will give you a non-uniform distribution!
@zoxon
zoxon / osx-for-hackers.sh
Created December 22, 2016 03:05 — forked from d-simon/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@zoxon
zoxon / jquery.dispatcher.js
Created December 22, 2016 03:05 — forked from d-simon/jquery.dispatcher.js
jQuery Mediator / Event Dispatcher
(function($) {
'use strict';
var $document = $(document.documentElement);
// Create the dispatcher
$.dispatcher = $.dispatcher || {};
var dispatcherMethods = {
trigger: function (event, data, elem) {
// If element is provided trigger from element

#Commit Message Guidelines (Shortened) This is a revamped proposal for structuring commit messages. It is a set of guidelines evolved from a need to scan, review and navigate commits quickly. They are ment to bring clarity to the commit history while retaining a lot of flexibility.

#Structure

[Action] Scope: Summary

Detailed Body Text (if necessary)
@zoxon
zoxon / query_string_parameter.js
Created December 22, 2016 03:05 — forked from d-simon/query_string_parameter.js
Query String Parameters
// http://stackoverflow.com/a/901144
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}