Skip to content

Instantly share code, notes, and snippets.

View noeljackson's full-sized avatar

Noël Jackson noeljackson

View GitHub Profile
<?php
$email = "youremail@example.com";
$apikey = yourkey;
$zoneid = yourzone;
$ch = curl_init( 'https://api.cloudflare.com/client/v4/zones/' . $zoneid . '/purge_cache' );
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('purge_everything' => true)) );
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
@noeljackson
noeljackson / docker-compose-swarm.sh
Last active September 27, 2020 17:56
Run docker-compose with docker-machine and docker-swarm on digital ocean
#from https://www.linux.com/learn/how-use-docker-machine-create-swarm-cluster
#export digital ocean token
export DO_TOKEN="abcdefghijklmnopqrstuvwxyz"
#make keystore
docker-machine create -d digitalocean \
-digitalocean-access-token ${DO_TOKEN} \
--digitalocean-region "nyc1" \
--digitalocean-image="ubuntu-14-04-x64" \
--digitalocean-size "512mb" \
@noeljackson
noeljackson / .gitignore
Created February 14, 2014 02:44
WordPress .gitignore
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
# Ignore everything in the "wp-content" directory, except the "plugins"
# and "themes" directories.
wp-content/*
!wp-content/plugins/
!wp-content/themes/
@noeljackson
noeljackson / location-hash-retrieval.js
Created April 8, 2013 23:21
Get a location.hash and then do stuff
var url = window.location.hash.toString();
var anchor = '#' + url.split('#')[1];
//if a hash is in a url, show that div
if (url.match('#')) $(anchor).show();
// if the hash changes, show that div
$(window).bind('hashchange', function() {
$(anchor).show();
@noeljackson
noeljackson / gist:5327360
Created April 6, 2013 19:45
getting libusb recognized on os x
git clone git://git.libusb.org/libusb.git
./autogen.sh
./configure
make
make install
# pkg-config --libs libusb-1.0
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
@noeljackson
noeljackson / resize.isotope.js
Last active December 15, 2015 13:39
isotope.js acting more responsively
$( this ).imagesLoaded(function() {
$container = $( '#container' );
function gallery_item_width() {
width = Math.floor( ($('#primary').width()) / 3 );
$( '#container .item' ).width( width + 'px' );
}
$(window).smartresize( gallery_item_width() );