Skip to content

Instantly share code, notes, and snippets.

View emjayess's full-sized avatar
💭
🪞 mirroring repos from gitlab

Matthew J. Sorenson emjayess

💭
🪞 mirroring repos from gitlab
View GitHub Profile
@emjayess
emjayess / percona-wizard-macaroni-mysql.cnf
Created September 17, 2012 17:31
sample mysql config via the percona configuration wizard
# Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208
[mysql]
# CLIENT #
port = 3306
socket = /usr/local/mysql/data/mysql.sock
[mysqld]
@emjayess
emjayess / seekParagraphs.js
Created September 13, 2012 22:45
finds <p>'s within a given context of a web page
(function(){
var context = arguments[0] || document.body
, pNodes = [], txtNodes = []
, ELM_NODE = 1, TXT_NODE = 3//, HTML_COMMENT_NODE = 8
, whitespace = /^\s*$/;
// more useful!
function seekParaNodes(ctx) {
if (ctx.nodeType == ELM_NODE && ctx.nodeName == 'P') {
pNodes.push(ctx); //console.log(ctx.textContent);
@emjayess
emjayess / contrib.drush.inc
Created August 15, 2012 21:50
capture, disable, and re-enable the currently enabled contrib modules in a drupal site
drush pml --no-core --type=module --status=enabled --pipe > contrib.modules.txt
# then
drush -y dis `cat contrib.modules.txt`
# later
drush -y en `cat contrib.modules.txt`
@emjayess
emjayess / pushkey.sh
Created August 10, 2012 16:20
push your public key to the authorized key file on your server
#!/bin/bash
# original source here: http://drupal.org/files/issues/pushkey.txt
#
# pushkey
#
# usage:
#
# pushkey [email protected]
@emjayess
emjayess / gist:3270360
Created August 6, 2012 04:22
nginx/1.2.1 (stable) installation configuration - precise pangolin
:~# nginx -V
nginx version: nginx/1.2.1
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-pcre-jit --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.2.1/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.
@emjayess
emjayess / drupal_w1zk1d.sql
Created July 27, 2012 14:36
grant permissions to a user on multiple mysql databases
# grant the following perms to 'w1zk1d' on all localhost db's with a name prefix of 'drupal_' ...
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `drupal_%`.* TO 'w1zk1d'@'localhost' IDENTIFIED BY 'kick@ss';
@emjayess
emjayess / amd-loading.js
Created July 17, 2012 19:13
alternative approaches / patterns to AMD-style module loading
/**
* AMD module loading patterns: 2 possible approaches
*/
define(['dojo/query', 'dojo/on'], function(query, on){
// my module code
});
// oft-favored for maintaining modules per line of code
define(function(require) {
@emjayess
emjayess / install-pear
Created July 11, 2012 19:43
install pear on os x lion, and drush via pear channel
### via http://blog.stealth35.com/2011/07/27/install-pear-on-osx-lion.html
# sudo cp /private/etc/php.ini.default /private/etc/php.ini
sudo php /usr/lib/php/install-pear-nozlib.phar
pear config-set php_ini /private/etc/php.ini
pecl config-set php_ini /private/etc/php.ini
sudo pear upgrade-all
# what about when using MAMP's php?
@emjayess
emjayess / the-anti-anchor.html
Created March 27, 2012 14:53
microsoft asp.net rage anti-pattern #743
<!-- what tha f*ck -->
<a id="ctl00_MasterBody_DownloadDetail_ctl02_DownloadFileLink" href="javascript:__doPostBack('ctl00$MasterBody$DownloadDetail$ctl02$DownloadFileLink','')">
@emjayess
emjayess / cache-fly.manifest
Created March 9, 2012 19:18
application caching on the fly
CACHE MANIFEST
# cache pages as they're visited
# display '/offline' when offline and hitting a page not yet cached...
FALLBACK:
/ /offline
NETWORK:
*