Skip to content

Instantly share code, notes, and snippets.

View stormwarning's full-sized avatar
👀

Jeff stormwarning

👀
View GitHub Profile
<?php
/* ------------------------------------------------------------------------------
* FILTER JETPACK OPEN GRAPH TAGS ADDITIONAL TWITTER CARD SUPPORT, FACEBOOK PUBLISHER, AND OG:META FIXES
* For the WordPress VIP environment.
* @see https://dev.twitter.com/docs/cards
* @see https://developers.facebook.com/blog/post/2013/06/19/platform-updates--new-open-graph-tags-for-media-publishers-and-more/
* ---------------------------------------------------------------------------- */
add_filter( 'jetpack_open_graph_tags', function( $tags ){
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
<?php
function geo_ip( $current_ip = 'none' ) {
$current_ip = ( 'none' == $current_ip ? $_SERVER['REMOTE_ADDR'] : $current_ip );
$url = 'http://freegeoip.net/json/' . $current_ip;
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, $url );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_HEADER, false );
@stormwarning
stormwarning / console.js
Last active August 29, 2015 14:05
Clever little console.log from mapbox.com
// Hiring smart people
if (typeof console !== 'undefined' && typeof console.log === 'function') {
console.log('\r\n%c * .--.\r\n%c \/ \/ `\r\n%c + | |\r\n%c \' \\ \\__,\r\n%c * + \'--\' *\r\n%c + \/\\\r\n%c + .\' \'. *\r\n%c * \/======\\ +\r\n%c ;:. _ ;\r\n%c |:. (_) |\r\n%c |:. _ |\r\n%c + |:. (_) | *\r\n%c ;:. ;\r\n%c .\' \\:. \/ `.\r\n%c \/ .-\'\':._.\'`-. \\\r\n%c |\/ \/||\\ \\|\r\n%c _..--\"\"\"````\"\"\"--.._\r\n%c _.-\'`` ``\'-._\r\n%c -\' %cHello, explorer%c \'-\r\n%c' +
'\n Curious? http://mapbox.com/jobs',
'color:#D0E3F1','color:#D0E3F1','color:#C0DAEC','color:#C0DAEC','color:#B0D1E8','color:#B0D1E8','color:#A1C7

Keybase proof

I hereby claim:

  • I am stormwarning on github.
  • I am stormwarning (https://keybase.io/stormwarning) on keybase.
  • I have a public key whose fingerprint is DCC1 710F F6EC 1BAE F346 D939 BC0A 96F4 9357 0C6C

To claim this, I am signing this object:

@stormwarning
stormwarning / aspect-ratio.scss
Created February 4, 2015 05:15
Sass (SCSS) variables for common aspect ratios.
/**
* Variables for common aspect ratios.
*/
$golden: 61.8047%; // 1.6180:1
$35mm: 66.6667%; // 3:2
$panorama: 33.3333%; // 3:1
$imax: 69.9301%; // 1.43:1
$widescreen: 56.1798%; // 1.78:1
{
"name": "theme_info",
"logo": "https:\/\/cdn.shopify.com\/s\/files\/1\/0070\/7032\/files\/2010_6_23_Shopify-Green_256x256.jpg",
"settings": [
{
"type": "header",
"content": "Shopify Cool Theme"
},
{
"type": "paragraph",
@stormwarning
stormwarning / init.coffee
Created July 20, 2015 14:59
Fix CLI Linter path setup in Atom.
#
# Fix CLI Linter path setup.
#
# @since 1.0.2
# @link https://github.com/AtomLinter/Linter/issues/726
#
childProcess = require( 'child_process' );
process.env.PATH = String(
childProcess.execFileSync(\
@stormwarning
stormwarning / mixin--font-specimen.scss
Last active December 14, 2015 10:39
Opinionated @font-face SASS mixin for embedding with better style and weight control.
/**
* Embed @font-face with better style and weight control.
*
@include font-specimen(OpenSans, normal, 300);
@include font-specimen(OpenSans, normal, 400);
@include font-specimen(OpenSans, italic, 600);
*
* Depends on a specific filename scheme; edit the `url` paths to match your setup.
*
*/
// Colours
$turquoise: #1abc9c;
$green-sea: #16a085;
$emerland: #2ecc71;
$nephritis: #27ae60;
$peter-river: #3498db;
$belize-hole: #2980b9;
$amethyst: #9b59b6;
$wisteria: #8e44ad;