Skip to content

Instantly share code, notes, and snippets.

View noeljackson's full-sized avatar

Noël Jackson noeljackson

View GitHub Profile
@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 / 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();
<?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 / cloudflare-purge.sh
Created February 9, 2017 04:23
Pure Cloudflare cache for a domain via the shell
#!/bin/bash
CFKEY=apikeygoeshere
CFUSER=you@example.org
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:

@noeljackson
noeljackson / fixperms.sh
Created September 6, 2018 11:27
fixperms.sh
#For directories only do this.
find . -type d -exec chmod 775 {} \;
#For files only do this.
find . -type f -exec chmod 644 {} \;