Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
tloudon / .gitignore
Created May 11, 2017
sample wp gitignore
View .gitignore
View sadfacecodecombatinstall.log
> bufferutil@1.1.0 install /var/www/codecombat/node_modules/bufferutil
> node-gyp rebuild
make: Entering directory `/var/www/codecombat/node_modules/bufferutil/build'
CXX(target) Release/
In file included from ../src/
../node_modules/nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
View i_can_has_api.php
$api_check = FALSE;
$headers = getallheaders();
foreach($headers as $key => $value) {
if (stripos($key, 'X-API') !== FALSE) {
$api_check = TRUE;
// you get the idea ^
// so contrib modules can get patches to opt-out of expensive hook_init/hook_boot or whatever rendering
// needs that may be horribly expensive and unnecessary for an API call
tloudon / bootstrap.php
Created Oct 6, 2015
bootstrap drupal, just to see how long it takes to load files, db, sessions, etc. no render
View bootstrap.php
define('DRUPAL_ROOT', getcwd());
include_once DRUPAL_ROOT . '/includes/';
View -
[OK] Logged in using credentials from debian maintenance account.
>> MySQLTuner 1.5.0 - Major Hayden <>
>> Bug reports, feature requests, and downloads at
>> Run with '--help' for additional options and output filtering
[OK] Currently running supported MySQL version 5.5.44-MariaDB-1ubuntu0.14.04.1
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Data in MEMORY tables: 125K (Tables: 1)
View www.conf
; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
tloudon / gist:5447808
Created Apr 23, 2013
old Harvest ruby client, just used for example and simplicity. Harvest has a newer, more robust, (official?) client @ available as the harvested gem.
View gist:5447808
# Insert your subdomain i.e.
SUBDOMAIN = 'mycompany'
# Your email. Note that features hidden from non-administrator
# accounts on the WEB UI will be inaccessible in the API as well. The
# full API is available to users with admin privileges only!
# Your password. Harvest uses HTTP Basic Auth.
ACCOUNT_PASSWORD = 'correcthorsebatterystaple'
View gist:4954427
20 function mongodb_session_user_update($edit, $account) {
21 // Update field values for changed values of the user.
22 $roles = _mongodb_session_get_roles($account);
23 // If mongodb_field_storage is enabled it will take care of creating
24 // initial user entry just add roles to it.
25 if (module_exists('mongodb_field_storage')) {
26 $wrote = &drupal_static('mongodb_field_storage_field_storage_write', array());
27 $wrote['user'][$account->uid] = TRUE;