Skip to content

Instantly share code, notes, and snippets.

@duzun
duzun / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
//*******************************************
// Level 1, basic API, minimum support
//*******************************************
/*
Modules IDs are strings that follow CommonJS
module names.
*/
//To load code at the top level JS file,
//or inside a module to dynamically fetch

The 10 Commandments of Modern Web Application

1. Instant Access

  • No Flash, Java or other plugins

2. Responsive Design

  • Responsive Layout
  • Mobile First
@duzun
duzun / install-addon
Last active August 29, 2015 14:20 — forked from jeffgca/install-addon
A node script that abuses child_process to run cfx and post the resulting xpi to Firefox.
#!/usr/bin/env node
/**
* A node script that abuses child_process to run cfx and post the resulting xpi to Firefox.
* Requires: a working installation of the Add-on SDK (with cfx on your PATH)
* and a recent version of Firefox with the 'Extension Auto-installer' extension installed.
*
* Original gist https://gist.github.com/canuckistani/9301061
*
* Improved by Dumitru Uzun (DUzun.Me)
@duzun
duzun / latency.markdown
Created May 7, 2016 14:51 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@duzun
duzun / ocp.php
Created June 7, 2016 10:55 — forked from ck-on/ocp.php
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@duzun
duzun / clone-es5.js
Created July 8, 2016 19:56 — forked from jherax/clone.js
JavaScript: clona o extiende un objeto
/**
* Creates a deep copy of an object
* @param {Any} from: Source object to clone
* @param {Object} dest: (Optional) destination object to merge with
* @return {Any} The cloned object
*/
var clone = (function() {
var _toString = Object.prototype.toString;
function _clone (from, dest, objectsCache) {