Skip to content

Instantly share code, notes, and snippets.

View noeljackson's full-sized avatar

Noel Jackson noeljackson

View GitHub Profile
@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() );
@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 / 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 / .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 / 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" \
<?php
$email = "[email protected]";
$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 / cloudflare-purge.sh
Created February 9, 2017 04:23
Pure Cloudflare cache for a domain via the shell
#!/bin/bash
CFKEY=apikeygoeshere
[email protected]
CFDOMAIN=yourdomain.com
CFZONE=$(curl -X GET "https://api.cloudflare.com/client/v4/zones?name=$CFDOMAIN&status=active&page=1&per_page=20&order=status&direction=desc&match=all" \
-H "X-Auth-Email: $CFUSER" \
-H "X-Auth-Key: $CFKEY" \
-H "Content-Type: application/json" \
| grep -Eo '"result\"\:\[\{"id":"([^"]+)"' \
@noeljackson
noeljackson / neo4j-docker-integration-test.sh
Last active October 4, 2017 10:28
Check to make sure Neo4j started properly.
#!/bin/bash
# Swap out docker-compose for docker run if you like.
docker-compose -f docker-compose.yml up -d
docker-compose ps
SECONDS=0; \
end="$((SECONDS+240))"; \
while true; do \
[[ $(docker-compose -f docker-compose.yml logs --tail=5 neo4j|grep "Remote interface available") ]] \
&& echo "Connected successfully to database." && break; \
[[ "${SECONDS}" -ge "${end}" ]] && echo "Can't connect to database.'" && exit 1; \
React.createClass({
// ...
onClicked() {
// Array of debounced click events
this.debouncedClickEvents = this.debouncedClickEvents || [];
// Each click we store a debounce (a future execution scheduled in 250 milliseconds)
const callback = _.debounce(_ => {
// YOUR ON CLICKED CODE

Keybase proof

I hereby claim:

  • I am noeljackson on github.
  • I am noeljackson (https://keybase.io/noeljackson) on keybase.
  • I have a public key ASCfwVNpJQSxMOwtgpZYZugDTboF7uRZN4dwyANY9PSwbAo

To claim this, I am signing this object: