Skip to content

Instantly share code, notes, and snippets.

Avatar

tloudon

View GitHub Profile
@tloudon
tloudon / .gitignore
Created May 11, 2017
sample wp gitignore
View .gitignore
*.log
.DS_Store
wp-config-sample.php
wp-config.php
wp-content/backupwordpress*
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
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/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../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
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
<?php
define('DRUPAL_ROOT', getcwd());
include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
View -
[OK] Logged in using credentials from debian maintenance account.
>> MySQLTuner 1.5.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> 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 -------------------------------------------
[--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MRG_MYISAM +SPHINX 
[--] 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)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
@tloudon
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 @ https://github.com/zmoazeni/harvested available as the harvested gem.
View gist:5447808
# Insert your subdomain i.e. subdomain.harvestapp.com
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!
ACCOUNT_EMAIL = 'tim@example.com'
# 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;
You can’t perform that action at this time.