Skip to content

Instantly share code, notes, and snippets.

View kalisjoshua's full-sized avatar

Joshua T Kalis kalisjoshua

View GitHub Profile
@kalisjoshua
kalisjoshua / .gitconfig
Last active December 16, 2015 18:59
My current .gitconfig.
[user]
name = Joshua T Kalis
email = kalisjoshua@gmail.com
[alias]
lg = log --graph --pretty=format:'%C(red)%h%C(reset) -%C(yellow)%d%C(reset) %s %C(green)(%cr) %C(blue)<%an>%C(reset)' --abbrev-commit --date=relative
oldest-ancestor = !zsh -c 'diff -u <(git rev-list --first-parent \"${1:-master}\") <(git rev-list --first-parent \"${2:-HEAD}\") | sed -ne \"s/^ //p\" | head -1' -
[core]
excludesfile = /Users/jkalis/.gitignore_global
[color]
branch = auto
@kalisjoshua
kalisjoshua / gist:5774480
Created June 13, 2013 15:10
git config global
user]
name = Joshua T Kalis
email = kalisjoshua@gmail.com
[alias]
lg = log --graph --pretty=format:'%C(red)%h%C(reset) -%C(yellow)%d%C(reset) %s %C(green)(%cr) %C(blue)<%an>%C(reset)' --abbrev-commit --date=relative
oldest-ancestor = !zsh -c 'diff -u <(git rev-list --first-parent \"${1:-master}\") <(git rev-list --first-parent \"${2:-HEAD}\") | sed -ne \"s/^ //p\" | head -1' -
webstart = instaweb --httpd=webrick
webstop = instaweb --httpd=webrick --stop
[core]
excludesfile = /Users/jkalis/.gitignore_global
@kalisjoshua
kalisjoshua / euler6.js
Created July 8, 2013 20:40
Project Euler #6 Code Golf
/*
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)2 = 552 = 3025
Hence the difference between the sum of the squares of the first
/*jshint laxcomma:true*/
var APICraft = (function APICraft_API_closure (baseURL) {
return function (endpoint) {
return baseURL + endpoint;
};
}('http://api.api-craft.org/conferences/detroit2013/'));
$.fn.ready(function ($) {
var DAYNAMES
, DAYNAMESLONG
// This F# dojo is directly inspired by the
// Digit Recognizer competition from Kaggle.com:
// http://www.kaggle.com/c/digit-recognizer
// The datasets below are simply shorter versions of
// the training dataset from Kaggle.
// The goal of the dojo will be to
// create a classifier that uses training data
// to recognize hand-written digits, and
// evaluate the quality of our classifier
@kalisjoshua
kalisjoshua / Article-BrowserSlides.md
Last active December 24, 2015 18:19
BrowserSlides Article [DRAFT]

I wrote a simple slides parser / formatter and presenter library in JavaScript, jQuery, and Markdown; OK, and some CSS and HTML.

History

I was asked by a former colleague to give a presentation on jQuery plugins to a few people he worked with at my former place of work. I thought it might be cute and a good exercise to write a plugin that converted a block of markdown text into HTML with the goal of using that HTML as the slide deck for the presentation.

As it turned out I rather liked the idea of having presentation slides as a markdown file rather than in a standard presentation software specific file format. I am a programmer through and through so I guess it should be no surprise to myself, or others, that I like, nay prefer, the markdown file format and don't mind working in it at length.

@kalisjoshua
kalisjoshua / piratize.js
Created October 9, 2013 21:03
Piratize Plugin - make the headers of a website more Pirate-like.
(function piratize () {
$('h1, h2, h3, h4, h5, h6')
.each(function (_, el) {
el.innerHTML = el.innerHTML
.split(' ')
.reduceRight(function (acc, word) {
if (!acc[1] && /r/.test(word)) {
word = word.replace(/(.*)(r+)/i, '$1$2rrrr');;
acc[1] = true;
}
@kalisjoshua
kalisjoshua / CommanderJavaScript.md
Created October 11, 2013 14:28
Article-CommanderJavaScript

Commander JavaScript

I have been wanting to gain some more Computer Science knowledge so I started reading more about Design Patterns. I have known about them for a long time and generally speaking my primary understanding ended at the Singleton pattern. I knew that there were other patterns defined but had no use for them since I didn't know them or how to use them.

Recently I have been building libraries of code more and have found that I like the Command Pattern a lot. Especially in JavaScript where some other language features are missing - or available depending on your point of view - which create problems for securing functionality from tampering.

Use Case

You are a developer wanting to create a new library for a particular purpose. You know that you are not going to necessarily think of everything, needed for other developers to use up front, so you want to also provide a way for them to add in features as they need to. You want to do this but don't want to allow them to harm the functionalit

@kalisjoshua
kalisjoshua / README.md
Last active December 25, 2015 07:19
Josh writes JavaScript

My Writings

  1. Commander JavaScript
Evolving the shopping cart into a Command Pattern in JavaScript.
  1. BrowserSlides
Writing a slide-deck presentation framework in the browser.
@kalisjoshua
kalisjoshua / AngularServiceDependencies.md
Last active January 2, 2016 19:49
Angular Service Dependencies

Angular Service Dependencies

I am trying to make one Service (SecondService) a dependency of another (FirstService), where the result from one is going to joined with portions of another.

Disclaimer: I have about 8-10 hours of total AngularJS experience.