Skip to content

Instantly share code, notes, and snippets.

Jason Siffring siffring

Block or report user

Report or block siffring

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@siffring
siffring / gist:7238625
Created Oct 30, 2013
An asynchronous loader for TypeKit
View gist:7238625
<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 Dec 16, 2015
Google Chrome Inspector Stylesheet
View 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:
View .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
View .gitconfig
# 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 / gist:3130009
Created Jul 17, 2012
Export ExpressionEngine members to CSV
View gist:3130009
<?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 / .htaccess
Created Mar 4, 2012
htaccess to password protect a specific server
View .htaccess
# ----------------------------------------------------------------------
# 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:1608761
Created Jan 13, 2012
How to sync Sublime Text 2 user packages using Dropbox
View gist:1608761
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 Oct 7, 2011
Javascript: pass a function as a parameter to another function
View function_as_parameter.js
// 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 Apr 28, 2011
ExpressionEngine list of new members by month
View gist:946604
{!-- 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}
View IE7-CrossBrowser-Cookie-Fix-For-Facebook.php
You can’t perform that action at this time.