Skip to content

Instantly share code, notes, and snippets.

View bkonkle's full-sized avatar

Brandon Konkle bkonkle

View GitHub Profile
@bkonkle
bkonkle / client_config.js
Created November 6, 2013 03:58
Handing off config variables to the frontend
define(function (require) {
'use strict';
var Cookies = require('cookies-js');
var configJson = Cookies.get('config');
if (configJson.slice(0, 2) === 'j:') {
return JSON.parse(configJson.slice(2));
}
});
@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 / SafeStringComponent.jsx
Created November 21, 2014 21:24
SafeStringComponent
var React = require('react');
/**
* A more usable wrapper around React's dangerouslySetInnerHTML. This should only be used for
* safe server-provided data that cannot be manipulated by an external user. This will render
* HTML, so tags inside will become actual DOM elements.
*
* Do not abuse this.
*
* (╯°□°)╯︵ ┻━┻
@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 / gist:cb0abc09af20ce115583
Created April 7, 2015 18:12
Simple JSX compile task
var args = require('../utils').args;
var debug = require('gulp-debug');
var gulp = require('gulp');
var gutil = require('gulp-util');
var notifier = require('node-notifier');
var path = require('path');
var plumber = require('gulp-plumber');
var react = require('gulp-react');
var production = (args.env === 'production');
@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

Brandon Konkle's Atom Settings

This is a gist to use with the sync-settings atom package.