Skip to content

Instantly share code, notes, and snippets.

View LongLiveCHIEF's full-sized avatar

Brian Vanderbusch LongLiveCHIEF

View GitHub Profile
#!/usr/bin/env python
"""
This script helps migrating issues from Bitbucket to GitHub.
It currently ignores milestones completly and doesn't care whether an issue is
open, new or on hold. As long as it's not closed it's considered open.
To use it, install python-bitbucket, PyGithub and ipdb.
@LongLiveCHIEF
LongLiveCHIEF / module.service.md
Last active August 29, 2015 13:56
A walkthrough of AngularJS service/factory/provider injenction into a module.config object using deferred promise
var app = angular.module('app',['ui.router']);

app.service('api',function($http){
    var user,autherror, apihost, requestpath;
    return {
        authorize:function(){
            var deferred = $q.defer();

            deferred.promise = $http.get(apihost+'/'+requestpath) //$http returns a promise object

.success(function(data){

@LongLiveCHIEF
LongLiveCHIEF / config.js
Last active August 29, 2015 13:56
SharePoint site provider factory
.config(['spSiteProvider',function(spSiteProvider){
spSiteProvider.siteSvcUrl('https://myspsite.com/_vti_bin/listdata.svc')
}])
@LongLiveCHIEF
LongLiveCHIEF / app.js
Created August 3, 2014 21:32
Module Pattern for creating a "step" and passing it handler functions
var step1 = new Step($elem);
// an example handler funciton
var highlightStep = function(){
this.$elem.addClass('highlight');
}
step1.addHandler(highlightStep);
@LongLiveCHIEF
LongLiveCHIEF / BetterIntro.md
Last active August 29, 2015 14:04
Promises - A Better Tutorial

Resolve a promise from a custom promise

Or: Turning a function into a promise

What most Angular Promise Tutorials Fail to teach You: Creating the promise

So many times while learning how to use promises, or trying to use them in my Angular applications, I would discover pieces of functionality that needed to be a promise, but weren't a $resource (or one of it's derivates).

Most tutorials show a final result of something like this:

@LongLiveCHIEF
LongLiveCHIEF / workbench.md
Last active August 29, 2015 14:13
Maker's Workbench

Maker's Workbench Plans

Name it!

-Maybe a cool acronym? some keywords: Workbench, bench, *bench, Make*, Hack, elec*, enginer*, pro, elite, deluxe, super, lab, static, voltage, variable voltage, linux, arduino, internet enabled

  • WBMHEIPDSLVA
  • (LEW/LEWb) Loaded Engineer's Workbench

Requirements

/** @jsx React.DOM */
var RenderedDeck = React.createClass({
render: function() {
return <div id={this.props.id} className="deck" dangerouslySetInnerHTML={{__html:this.props.contents}}></div>;
}
});
var Deck = React.createClass({
render: function() {
@LongLiveCHIEF
LongLiveCHIEF / Description.md
Last active August 29, 2015 14:19
npm-contractor

NPM Contractor

A chef/puppet like tool that allows you to use npm scripts as your build tool, even with complicated tasks, by creating "contracts". After creating these contracts, they can be published to npm using the npm-contract- to be automatically parsed and utilized by npm install

(I intend to fork npm, and add support for a "contracts" object in package.json, but this should work even if it's not added to the npm tool itself")

Benefits

  • get the benefits of "configuration" (ala Grunt), with the native javascript composability of gulp
  • uses native OS streaming/piping, stdout/stdin/stderr
@LongLiveCHIEF
LongLiveCHIEF / .tmux.conf
Last active August 29, 2015 14:23
Shell Setup
source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-shell /bin/zsh
set-option -g default-terminal "xterm"
set-window-option -g mode-keys vi
set-option -g mouse-select-window on
set-option -g allow-rename off
set-window-option -g mode-mouse on
bind h select-pane -L
bind j select-pane -D
@LongLiveCHIEF
LongLiveCHIEF / Converting libraries to Ember CLI addons.md
Created December 4, 2015 20:00 — forked from kristianmandrup/Converting libraries to Ember CLI addons.md
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.