Skip to content

Instantly share code, notes, and snippets.

Jeff Farley JeffreyMFarley

Block or report user

Report or block JeffreyMFarley

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
@JeffreyMFarley
JeffreyMFarley / list.py
Created Apr 25, 2019
Programmatically List S3 contents
View list.py
from __future__ import print_function
import boto3
import configargparse
import sys
# -----------------------------------------------------------------------------
# Process
# -----------------------------------------------------------------------------
@JeffreyMFarley
JeffreyMFarley / 2017-10-26 - Grunt to Webpack.md
Last active Aug 1, 2018
2017-10-26 - Grunt to Webpack.md
View 2017-10-26 - Grunt to Webpack.md
  1. npm i -D css-loader eslint-loader file-loader less-loader postcss-loader string-replace-loader style-loader url-loader

Include HTML & Images in webpack

  1. //@require "../../**/*.html" => too many errors
  2. //@require "../../**/*.png" => hey look! embedded urls, but are the paths right?
    1. require('../../partial/header.html'); => Can't resolve './static/images/logo.png'
      1. https://www.npmjs.com/package/resolve-url-loader => hrm
      2. change the src tag in header.html => no dice
      3. https://github.com/webpack-contrib/html-loader
View Brewfile
cask_args appdir: '/Applications'
tap 'homebrew/bundle'
tap 'caskroom/fonts'
brew 'autoenv'
brew 'docker'
brew 'docker-compose'
brew 'docker-machine'
brew 'gcc'
View jasmine-custom-dictionary-log.js
jasmine.addCustomEqualityTester( ( a, b ) => {
const ak = Object.keys( a ).concat( Object.keys( b ) );
const unique = ak.filter( ( v, i, arr ) => arr.indexOf( v ) === i );
unique.sort();
for ( var i = 0; i < unique.length; i++ ) {
const k = unique[i];
if ( b[k] ) {
console.log( k, '\t', a[k], '\t', b[k] );
}
View geohash.js
// https://en.wikipedia.org/wiki/Geohash
// or just use https://github.com/chrisveness/latlon-geohash/blob/master/latlon-geohash.js
// SOURCE: https://codepen.io/jthomassie/pen/lvoGe?editors=0010
function refine_interval(interval, cd, mask) {
if (cd & mask) {
interval[0] = (interval[0] + interval[1]) / 2;
} else {
interval[1] = (interval[0] + interval[1]) / 2;
@JeffreyMFarley
JeffreyMFarley / app.js
Last active May 18, 2018
HTTP via Middleware
View app.js
import { applyMiddleware, createStore } from 'redux'
import reducers from './reducers';
import thunkMiddleware from 'redux-thunk'
import httpRequestHandler from './httpRequestHandler';
const middleware = [ thunkMiddleware, httpRequestHandler ];
const composeEnhancers = composeWithDevTools( {
// required for redux-devtools-extension
// Specify name here, actionsBlacklist, actionsCreators and other options
View skip-install.groovy
new BaseJobBuilder(
name: "pr-builder",
description: 'Run unit tests when a pull request is submitted',
).build(this).with {
GhUtils.ghPrWatcher(delegate,
[
ghProject: 'foo/bar',
ghHostname: 'github.com',
ghAuthId: '<#########>',
ghPermitAll: true,
View redux-store-logger.jsx
const logger = store => next => action => {
console.log( 'dispatching', action );
const result = next( action );
console.log( 'next state', store.getState() );
return result;
};
@JeffreyMFarley
JeffreyMFarley / looping-pu.sh
Last active Oct 13, 2017
pu.sh (infinite loop version)
View looping-pu.sh
#!/bin/sh
setup_git() {
# Set the user name and email to match the API token holder
# This will make sure the git commits will have the correct photo
# and the user gets the credit for a checkin
git config --global user.email "foo@users.noreply.github.com"
git config --global user.name "foo"
git config --global push.default matching
View mtv-amp-songs.txt
aqualite ride the rhythm
art of noise close to the edit
astrud gilberto with stan getz the girl from ipanema
atari teenage riot kids are united
atari teenage riot sick to death
atari teenage riot speed
atomic babies purple
autechre second bad vilbel
aux 88 electro/techno
bally sagoo dil cheez
You can’t perform that action at this time.