Skip to content

Instantly share code, notes, and snippets.

View kimmellj's full-sized avatar

James Kimmell kimmellj

View GitHub Profile
@kimmellj
kimmellj / web-dev-handbook.md
Last active January 9, 2026 16:53
A list of things I've picked up over the years and want to share with the next generation of developers.
const fs = require('fs');
const fileContents = fs.readFileSync(process.argv[2]).toString();
const regex = /\$[A-Za-z\-]*:/g;
let matches;
let variables = [];
while ((matches = regex.exec(fileContents)) !== null) {
* https://picular.co
@kimmellj
kimmellj / convert-mp4-to-gif.sh
Last active January 14, 2018 21:20
Convert an MP4 to a GIF
#!/bin/bash
mkdir kay-head-shake
mv Kay\ Head\ Shake.mp4 kay-head-shake/kay.mp4
cd kay-head-shake/
mkdir frames
ffmpeg -i kay.mp4 -r 5 'frames/frame-%03d.jpg'
cd frames/
convert -delay 20 -loop 0 *.jpg ../kay.gif
cd ../
var regex = /\d+/g;
var hourCount = 0;
jQuery("td.timeoriginalestimate").each(function(){
var origTime = jQuery(this).text();
if (origTime.indexOf("hours") > -1) {
var results = regex.exec(origTime);
if (results) {
var numresults = results.length;
#!/usr/bin/ruby
require 'csv'
xmlString = '<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.demandware.com/xml/impex/catalog/2006-10-31" catalog-id="nautica-master-catalog">
'
batch = ARGV[0]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0"/>
<script type='text/javascript' src="js/jquery.min.js"></script>
<script type='text/javascript' src="js/kendo.all.min.js"></script>
/**
* To Call:
* node node public-pipeines.js ../HAR/har-demandware/
* @todo Better paramter management
*/
var DWREUtils = require('./dwre-util.js'),
fs = require('fs'),
async = require('async'),
path = require('path'),
recursive = require('recursive-readdir');
@kimmellj
kimmellj / configuration.js
Created March 18, 2015 19:04
Configuration Singleton Example - JavaScript
/**
* http://robdodson.me/javascript-design-patterns-singleton/
* http://addyosmani.com/resources/essentialjsdesignpatterns/book/#singletonpatternjavascript
*/
var Configuration = (function () {
// Instance stores a reference to the Singleton
var instance;
@kimmellj
kimmellj / Configuration.java
Last active September 28, 2022 20:06
Configuration Singleton Example - Java
package nettail;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.logging.Level;
import java.util.logging.Logger;