Skip to content

Instantly share code, notes, and snippets.

View siffring's full-sized avatar

Jason Siffring siffring

View GitHub Profile
@siffring
siffring / .htaccess
Created March 4, 2012 17:33
htaccess to password protect a specific server
# ----------------------------------------------------------------------
# Password protect staging server
# Use one .htaccess file across multiple environments
# (e.g. local, dev, staging, production)
# but only password protect a specific environment.
# ----------------------------------------------------------------------
SetEnvIf Host staging.domain.com passreq
AuthType Basic
AuthName "Password Required"
@siffring
siffring / gist:3130009
Created July 17, 2012 15:16
Export ExpressionEngine members to CSV
<?php
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename=member_export.csv');
header('Pragma: no-cache');
?>
{!--
Exports the EE members in CSV format. This is only accessible to admins and editors.
Does not export members in the banned or guests groups.
@siffring
siffring / gist:7238625
Created October 30, 2013 19:25
An asynchronous loader for TypeKit
<script>
(function() {
var config = {
kitId: '[your typekit kit id goes here]',
scriptTimeout: 3000
};
var h=document.getElementsByTagName("html")[0];h.className+=" wf-loading";var t=setTimeout(function(){h.className=h.className.replace(/(\s|^)wf-loading(\s|$)/g," ");h.className+=" wf-inactive"},config.scriptTimeout);var tk=document.createElement("script"),d=false;tk.src='//use.typekit.net/'+config.kitId+'.js';tk.type="text/javascript";tk.async="true";tk.onload=tk.onreadystatechange=function(){var a=this.readyState;if(d||a&&a!="complete"&&a!="loaded")return;d=true;clearTimeout(t);try{Typekit.load(config)}catch(b){}};var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(tk,s)
})();
</script>
@siffring
siffring / Chrome Inspector Stylesheet
Last active December 16, 2015 12:48
Google Chrome Inspector Stylesheet
/*
* This stylesheet overrides the display of code in the Chrome Inspector.
* Put it here: ~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets/Custom.css
*/
/**********************************************/
/*
/* Darker Skin by Darcy Clarke - 2011
/*
/* Based on Joe Bergantine's Specials Board:
@siffring
siffring / .gitconfig
Created September 12, 2012 18:59
Git Config
# Set your name and email address. The rest can stay the same.
[user]
name = Your Name
email = your_email@surprisehighway.com
[alias]
st = status
di = diff
co = checkout
@siffring
siffring / .bash_login
Created September 12, 2012 19:02
.bash_login
# Some goodies for your /Users/[username]/.bash_login file
# Set your search path
PATH=$PATH:/usr/local/bin
export PATH
# Alias for clearing your dns cache
alias dnscacheflush='dscacheutil -flushcache'
# Alias for subl
@siffring
siffring / gist:1608761
Created January 13, 2012 21:20
How to sync Sublime Text 2 user packages using Dropbox
1) In your Dropbox directory, create a new directory called SublimeUserPackages
2) Open terminal
3) Go to Sublime's packages directory
cd ~/Library/Application Support/Sublime Text 2/Packages
4) Copy the user packages to your new dropbox folder
cp -rp User/* ~/Dropbox/SublimeUserPackages/
@siffring
siffring / function_as_parameter.js
Created October 7, 2011 18:14
Javascript: pass a function as a parameter to another function
// pass a function as a parameter of another function
function doAnotherThing() {
console.log('Doing another thing…');
}
function doSomething(callback) {
console.log('Doing something…');
if (typeof callback == 'function') {
callback.call();
@siffring
siffring / gist:946604
Created April 28, 2011 15:42
ExpressionEngine list of new members by month
{!-- Displays the number of new ExpressionEngine members by month --}
{exp:query sql="select count(*) AS total, month(from_unixtime(join_date)) as month, year(from_unixtime(join_date)) as year from exp_members group by year, month order by year DESC, month DESC"}
<br/>{year}-{month}: {total}
{/exp:query}