Skip to content

Instantly share code, notes, and snippets.

View bkonkle's full-sized avatar

Brandon Konkle bkonkle

View GitHub Profile
@bkonkle
bkonkle / test.js
Last active August 29, 2015 14:01
(function() {
'use strict';
var CastawayApp, React, ReactTestUtils, chai, document, jsdom, sinon, sinonChai, window, xhr;
chai = require('chai');
jsdom = require('jsdom');
sinon = require('sinon');
/*
* Backbone's extend functionality, which is almost identical to CoffeeScript's
* method. This will make it easy to extend classes originally created in
* CoffeeScript.
*
* From: https://github.com/jashkenas/backbone/blob/c33dcdeffd85a5b749100249b8b9de7be44a0594/backbone.js#L1648
*/
'use strict';
var _ = require('underscore');
@bkonkle
bkonkle / keyframes.less
Last active August 29, 2015 14:08
Less Keyframes Mixin
// The mixins
// ---------------------------------------------------------------------
.keyframes(@name, @frames) {
@-webkit-keyframes @name { @frames(); }
@keyframes @name { @frames(); }
}
.transform(@string) {
-webkit-transform: @string;
-ms-transform: @string;
@bkonkle
bkonkle / keybase.md
Last active August 29, 2015 14:17
keybase.md

Keybase proof

I hereby claim:

  • I am bkonkle on github.
  • I am bkonkle (https://keybase.io/bkonkle) on keybase.
  • I have a public key whose fingerprint is 5ECB 7AE5 E676 B756 0847 8155 92CA 09D7 374F DC00

To claim this, I am signing this object:

@bkonkle
bkonkle / python.md
Created April 1, 2015 16:04
Announcing the New Craftsy codebase!

After a month of intensive head down coding, I’m ready to reveal what I’ve really been working on all this time. Today I’m proud to announce that we’re moving Craftsy’s codebase to Python! We’ll be leveraging the innovative and exciting Django framework so that we can take advantage of its rich standard library, powerful ORM, and active open source community.

Django

With Python’s whitespace sensitivity our developers will no longer have to labor over endless brackets and semicolons! Think of all the keystrokes saved! With the Django ORM, our developers can finally get away from knowing anything about SQL and focus on writing creative and clever comprehensions, decorators, and multi-inheritance mixins! With Python’s rich, dynamic monkey patching capabilities our developers can modify behavior at runtime whenever and wherever they want! Now you, too, can participated in heated, sometimes violent discussions about the Python 2 to 3 transition!

To help us make this compellin

@bkonkle
bkonkle / .eslintrc
Created July 22, 2015 15:10
.eslintrc
{
"parser": "babel-eslint",
"plugins": ["react"],
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"modules": true,
"jsx": true
@bkonkle
bkonkle / share-with-google-reader.html
Created February 23, 2010 23:42
A quick snippet demonstrating how I got a "Share with Google Reader" button working on PegasusNews.com. This assumes that you are using jQuery.
<a href="http://www.google.com/reader" id="greader-share">Share with Google Reader</a>
<script type="text.javascript">
$('#greader-share').click(function() {
GR________bookmarklet_domain = 'http://www.google.com';
$.getScript('http://www.google.com/reader/ui/link-bookmarklet.js');
return false;
});
</script>
@bkonkle
bkonkle / collatz.py
Created March 7, 2010 16:24
XKCD inspired me to write a quick Collatz Conjecture script in Python
import random
def main():
start = n = round(random.random() * 100000)
i = 0
while not n == 1:
i += 1
if n % 2:
# The remainder isn't zero, so this evaluates to True
@bkonkle
bkonkle / prefixed.py
Created June 3, 2010 23:00
Jeremy Dunck wrote this cache backend for Pegasus News, and I've been given permission to open-source it. I'm going to create a full Github repository with a setup.py for easy pip install, and I also plan to contribute it to Django. For now though, I'm
import types
from django.conf import settings
from urllib import urlencode
from django.core.cache.backends.base import BaseCache
from django.utils.encoding import smart_str
#future-proofing against any Django upstream additions of new cache methods.
# If we didn't do this, we'd silently use the base class's methods, which wouldn't
# use the prefix as required.
_expected_methods = set(['__contains__', '__init__', 'add', 'close',
@bkonkle
bkonkle / com.danga.memcached.plist
Created June 22, 2010 18:54
On-demand launchd plists for common web development daemons
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.danga.memcached</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/memcached</string>
<string>-u</string>