Skip to content

Instantly share code, notes, and snippets.

View bangline's full-sized avatar

Dave Kennedy bangline

View GitHub Profile
@bangline
bangline / api.md
Created June 21, 2016 22:55
Example API doc generated
hello world
goodbye world
@bangline
bangline / soda_transaction.rb
Created September 20, 2014 11:16
Soda Transaction
require 'rubygems'
require 'state_machine'
# ruby -v - ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
# gem -v - 2.2.2
# gem list state_machine - state_machine (1.2.0)
class SodaTransaction
attr_accessor :selection
@bangline
bangline / app.js
Created March 18, 2014 01:13
Testing Controler Interactions with Ember Data store
App.DebateController = Ember.ObjectController.extend({
pointText: '',
actions: {
createPoint: function() {
var newPoint = this.store.createRecord('point', {
detail: this.get('pointText'),
});
var controller = this;
newPoint.save().then(function(point) {
controller.set('pointText', '');
@bangline
bangline / Gruntfile.coffee
Last active December 26, 2015 06:39
CORS with Grunt
connect:
options:
port: 9000
livereload:
options:
middleware: (connect) -> [
lrSnippet,
mountFolder(connect, '.tmp'),
(req, res, next) ->
res.setHeader('Access-Control-Allow-Origin', '*')
[
{ "keys": ["alt+s"], "command": "toggle_side_bar" },
{ "keys": ["super+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["super+down"], "command": "select_lines", "args": {"forward": true} },
{ "keys": ["ctrl+shift+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["alt+super+up"], "command": "swap_line_up" },
{ "keys": ["alt+super+down"], "command": "swap_line_down" },
{
"keys": ["super+alt+]"],
"command": "reindent",
@bangline
bangline / Vagrantfile
Created September 8, 2013 19:06
Vagrantfile for WP
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
<%-# app/views/spree/admin/payments/source_views/_worldpay.html.erb %>
<fieldset>
<legend>WorldPay</legend>
<table class="index">
<tr>
<th colspan="6">Payment Details - WorldPay </th>
</tr>
<tr>
<td><label>Amount:</label></td>
@bangline
bangline / word_count.rb
Created August 25, 2013 22:17
Word count
class Phrase
def initialize(phrase)
@phrase = phrase
end
def word_count
WordCounter.new.count(@phrase)
end
end
# ...
describe "some path" do
include Rack::Test::Methods
describe "dashboard" do
before { get '/' }
it "will update the page with a given value" do
last_response.should be_ok
last_response.body.should have_element_with_value('span#current_jobs_ready', '1')