Skip to content

Instantly share code, notes, and snippets.

View thealexbaron's full-sized avatar

Alexander Baron thealexbaron

View GitHub Profile
@thealexbaron
thealexbaron / create-odbc-test-order.sql
Last active May 11, 2022 20:31
odbc create test db queries
CREATE TABLE test_order (
`orderId` int unsigned NOT NULL AUTO_INCREMENT,
orderNumber varchar(255),
orderDate varchar(255),
shipperReference varchar(255),
shipperReference2 varchar(255),
shippingService varchar(255),
orderGroup varchar(255),
`name` varchar(255),
company varchar(255),
@thealexbaron
thealexbaron / prepare-commit-msg.sh
Last active November 16, 2017 16:40 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# per @madeindjs's suggestion:
# For a quick install, into your project folder enter this command line:
#
# curl https://gist.githubusercontent.com/thealexbaron/fd2a390dc6f8958d1b1ffe8b66b676bb/raw/5f5ed22c281a8488116a41e4496075f8b28d106a/prepare-commit-msg.sh > .git/hooks/prepare-commit-msg && chmod u+x .git/hooks/prepare-commit-msg
#
# which does:
# - get Gist
# - copy into .git/hooks/prepare-commit-msg file
@thealexbaron
thealexbaron / ssh-helper.pl
Last active June 15, 2017 16:38
SSH Config Helper
#!/usr/bin/perl
use strict;
use warnings;
use Scalar::Util qw(looks_like_number);
use Data::Dumper;
# update https://gist.github.com/thealexbaron/45fb567e2c1349983865adbfe6945b57 when we update this file
@thealexbaron
thealexbaron / us-tax-tables-2012-2013-2014.json
Last active September 20, 2015 15:53
Individual Federal Income Tax Rates by Tax Year (2012, 2013, 2014)
{
"2012":{
"single":[
{
"bracket":"8700",
"percent":"10"
},
{
"bracket":"35350",
"percent":"15"
@thealexbaron
thealexbaron / PendingData-test.js
Last active August 29, 2015 14:14
Test loading indicator component for ReactJS
/** @jsx React.DOM */
jest.dontMock('../components/pendingData.jsx');
describe('PendingData', function() {
var React = require('react/addons');
var PendingData = require('../components/pendingData.jsx');
var TestUtils = React.addons.TestUtils;
import java.util.Random;
public class Fields
{
Random dice = new Random();
int oneDThree;
public void getRand()
{
@thealexbaron
thealexbaron / basicAsyncLoop.js
Last active August 29, 2015 14:13
Extremely Basic Asynchronous Loop
var iterationCount = 3;
function doIterations(cb) {
if (iterationCount !== 0) {
// print the number of iterations, then wait 5 seconds
setTimeout(function(){ console.log(iterationCount); iterationCount --; doIterations(cb); }, 500);
}
else {
// now that we're done, fire the callback (if one exists)
cb && cb();
}