// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell script to backup MySql database | |
# CONFIG - Only edit the below lines to setup the script | |
# =============================== | |
MyUSER="root" # USERNAME | |
MyPASS="password" # PASSWORD | |
MyHOST="localhost" # Hostname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note that instance and class methods could also be defined at the adapter level | |
// (e.g. CRUD adapters add .save() and .destroy() methods, but the Twillio API might add a .call() method) | |
// User.js | |
module.exports = sails.Model.extend({ | |
// Adapters are applied from left to right | |
// (methods defined in more than one adapter use the rightmost adapter's version, just like _.extend) | |
adapter: ['mysql', 'twilio'], | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
if (process.argv.length < 3) { | |
console.error('Usage:', process.argv.join(' '), '/path/to/file.css'); | |
process.exit(1); | |
} | |
file = process.argv[2]; | |
var fs = require('fs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <script src="angular.min.js"></script> | |
(function(name, factory) { | |
// our basic IO module system that stores every module on modules with the "file" namespace | |
// please use something like browserify rather than rolling your own like this | |
window.modules = window.modules || {}; | |
window.require = window.require || function require(name) { return window.modules[name] || window[name]; }; | |
var exports = {}; factory(exports, window.require); | |
window.modules[name] = exports; | |
}('TodoService', function(exports, require) { |
- end-of-stream - specify a callback to be called when a stream ends (which is surpsingly hard to get right)
- duplexify - compose a Duplex stream from a Readable and a Writable stream
- pump - pipe streams together and close all of them if one of them closes
- pumpify - combine an array of streams into a single duplex stream using pump and duplexify
- through2 - tools for making Transform streams
- from2 - tools for making Readable streams
This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
OlderNewer