Skip to content

Instantly share code, notes, and snippets.

Avatar

Charles Lowell cowboyd

View GitHub Profile
View async-with-delayed-send.hbs
{{#with (async (ajax)) as |result|}}
{{#loading-overlay result.isPending}}
<button onclick={{action ajax.get '/products'}}>Load</button>
{{#with (list result) as |products|}}
{{#each (list products) as |item}}
{{item.title}}
<button {{action (action ajax.delete 'products/:id'
data=(hash id=item.id)
on-success=(action products.remove item))
on-error=(action notifications.error 'Could not delete item')
@cowboyd
cowboyd / gemconf.md
Last active May 24, 2016 — forked from elwayman02/gemconf-2016.md
GEMCONF Recap
View gemconf.md
View gist:b655fa367c8e6e12c344d1c29be8113c
+----------+
| | error(e)
+------| Error |<-------------------+-------------------------+
| | | | |
| +----------+ | |
| ^ | |
| | | |
| | | |
| |error(e) | |
| | | |
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setText(text) {
console.log('text=', text);
this.attrs.updateMessageAtIndexPath(message, indexPath);
}
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setText(text) {
this.attrs.updateMessageAtIndexPath(message, indexPath);
}
}
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
didRender() {
console.log('didRender');
console.log('pojo1', this.get('pojo1'));
console.log('pojo2', this.get('pojo2'));
console.log('pojo3', this.get('pojo3'));
}
View gist:2284276
require 'rubygems'
require 'v8'
def print_resources
rss = /\w*[ ]*#{Process.pid}[ ]*([.,\d]*)[ ]*([.,\d]*)[ ]*([\d]*)[ ]*([\d]*)/.match(`ps aux`)[4]
print "resources: #{rss.to_i/1024}MB\n"
end
print_resources
View gist:2159112
require 'jenkins/plugin/behavior'
module Jenkins
#
# Defines the equivalent of `hudson.Extension`
#
module Extension
extend Plugin::Behavior
module ClassMethods
@cowboyd
cowboyd / hacks.rb
Created Nov 15, 2011 — forked from metaskills/hacks.rb
Failed ImportProcessor
View hacks.rb
module Less
module Rails
class ImportProcessor < Tilt::Template
IMPORT_SCANNER = /@import\s*['"]([^'"]+)['"]\s*;/.freeze
def prepare
end
def evaluate(context, locals, &block)
View gist:1364796
# Sets the repository URL based on the given repository.
# Valid uses:
# * uses_repository :github => 'me/my-plugin'
# * uses_repository :github => 'my-plugin' -- Implies hosting under the
# jenkinsci organization.
# * uses_repository :git => 'https://code.google.com/p/my-plugin'
# * uses_repository :svn => 'https://svn.jenkins-ci.org/trunk/hudson/plugins/my-plugin'
def uses_repository(opts)
#impl
end