Skip to content

Instantly share code, notes, and snippets.

View alexweber's full-sized avatar

Alex Weber alexweber

View GitHub Profile
@alexweber
alexweber / settings.php
Created March 7, 2014 17:57
settings.php alta performance (apc + memcache + authcache)
<?php
# APC.
$conf['cache_backends'][] = 'sites/all/modules/contrib/apc/drupal_apc_cache.inc';
// $conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
# Memcache.
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['lock_inc'] = 'sites/all/modules/contrib/memcache/memcache-lock.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
@alexweber
alexweber / .gitconfig
Created December 12, 2014 11:06
Minimalistic sensible defaults .gitconfig
[core]
filemode = false
[alias]
co = checkout
st = status
ci = commit
l = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
[color]
ui = auto
@alexweber
alexweber / raptorize-css3.js
Created February 23, 2013 07:33
Modernizr-enhenced jQuery Raptorize plugin using CSS3 transitions and transforms with animate() fallback. (Only includes the changed parts)
// This obviously requires a Modernizr build with support for csstransforms, csstransitions and audio.
// All vendor prefixes included for clarity.
// First some better checking for HTML5 Audio
if (Modernizr.audio.mp3) {
audioSupported = true;
raptorAudioMarkup = '<audio id="elRaptorShriek" preload="auto"><source src="' + prefix + 'raptor-sound.mp3" /></audio>';
}
else if (Modernizr.audio.ogg) {
audioSupported = true;
@alexweber
alexweber / hoisting.js
Last active April 15, 2016 17:55
Hoisting examples
// Example 1
var foo = 1;
function bar() {
if (!foo) {
var foo = 10;
}
alert(foo);
}
bar();
From e954bc23404f8eb5db37ae8acbed8ca7a16f358b Mon Sep 17 00:00:00 2001
From: Alex Weber <alexweber15@gmail.com>
Date: Wed, 27 Apr 2016 15:06:41 -0300
Subject: [PATCH] fix call-time pass by reference error
---
.../modules/vrweb/vrfusion_grouping/views/views_plugin_pager_groups.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sites/all/modules/vrweb/vrfusion_grouping/views/views_plugin_pager_groups.inc b/sites/all/modules/vrweb/vrfusion_grouping/views/views_plugin_pager_groups.inc
@alexweber
alexweber / buster.py
Last active October 28, 2017 08:24
hacked buster.py for my personal site
"""Ghost Buster. Static site generator for Ghost.
Usage:
buster.py setup [--gh-repo=<repo-url>] [--dir=<path>]
buster.py generate [--domain=<local-address>] [--dir=<path>] [--github-id=<github-id>]
buster.py preview [--dir=<path>]
buster.py deploy [--dir=<path>]
buster.py add-domain <domain-name> [--dir=<path>]
buster.py (-h | --help)
buster.py --version
handler: () => {
return this.data.load().then(() => {
return alert.dismiss();
}).then(() => {
this.nav.pop();
});
return false;
}
@alexweber
alexweber / create-plugin.js
Last active August 14, 2018 00:24
create plugin script
'use strict';
const requestify = require('requestify');
const homedir = require('os').homedir();
const cfg = require(homedir + '/.maya/mayarc.json');
// Load default dev token and namespace prefix from glboal user config.
const token = cfg.token;
const prefix = cfg.prefix;
@alexweber
alexweber / CONVENTIONS.md
Created June 5, 2018 17:22
Git Commit Conventions

Git Commit Conventions

Commit Conventions

<type>(scope): message

Types

  • feat (features)
  • fix (bug fixes)