Skip to content

Instantly share code, notes, and snippets.

View jeremywrowe's full-sized avatar
❤️
Coding

Jeremy W. Rowe jeremywrowe

❤️
Coding
View GitHub Profile
@jeremywrowe
jeremywrowe / gist:3506869
Created August 29, 2012 04:33
highcharts - show label for first and last data points in a series
plotOptions: {
line : {
dataLabels : {
enabled : true,
formatter: function() {
var first = this.series.data[0],
last = this.series.data[this.series.data.length - 1];
if ((this.point.category === first.category && this.point.y === first.y) ||
(this.point.category === last.category && this.point.y === last.y)) {
return this.point.y;
@jeremywrowe
jeremywrowe / ember.projections.json
Created September 18, 2015 23:30
Ember Projection for Projectionist Projects
{
"app/adapters/*.js": {
"command": "adapter",
"template": [
"import ApplicationAdapter from './application';",
"",
"export default ApplicationAdapter.extend({",
"",
"});"
],
@jeremywrowe
jeremywrowe / pipe.rb
Created January 12, 2019 16:00
A light weight pipe implementation in ruby
#!/usr/bin/env ruby
class PipeNode
attr_writer :result
def initialize(value, chain)
@value = value
@chain = chain
@result = :unknown
end
@jeremywrowe
jeremywrowe / gist:3853416
Created October 8, 2012 16:27
id-tap-that-3
def top_three_scores
[2,1,4,3].tap{|a| a.sort! }.tap{|a| a.reverse! }.tap{|a| a.select!{|s| s > 1}} # => [4,3,2]
end

Keybase proof

I hereby claim:

  • I am jeremywrowe on github.
  • I am jeremywrowe (https://keybase.io/jeremywrowe) on keybase.
  • I have a public key ASBqyp6W1b4t7Yb2OUNONUPaIbFd3fTaqEQA3ZqgpyrPiwo

To claim this, I am signing this object:

@jeremywrowe
jeremywrowe / .projections.json
Last active August 20, 2017 19:10 — forked from chantastic/.projections.json
ember-cli VIM projections
{
"app/adapters/*.js": {
"command": "adapter",
"template": [
"import ApplicationAdapter from './application';",
"",
"export default ApplicationAdapter.extend({",
"",
"});"
],
@jeremywrowe
jeremywrowe / too_legit.c
Last active August 11, 2016 17:52
Bringing goto statements in c back into style.
#include <stdlib.h>
#include <stdio.h>
#define too goto
int main( int argc, const char* argv[]) {
int times;
times = 0;
legit:
printf(" too legit,");
@jeremywrowe
jeremywrowe / Vagrantfile
Last active June 11, 2016 14:34 — forked from bbaaxx/Vagrantfile
Vagrantfile for a cheap ember-cli box (with NVM)
# -*- mode: ruby -*-
# vi: set ft=ruby :
box = 'ubuntu/trusty64'
hostname = 'emberclibox'
domain = 'example.com'
ip = '192.168.42.42'
ram = '1024'
$rootScript = <<SCRIPT
@jeremywrowe
jeremywrowe / ember-data-1.13-cheatsheet.md
Created August 17, 2015 17:00
Ember Data v1.13.x Cheatsheet

Ember Data v1.13.x Cheatsheet

Things to remember

  • If you return a promise beforeModel, model, and afterModel in a route, it will wait to resolve the promise before transitioning into the route. This is helpful when using loading and error substate templates.

  • All ember data records go into a global cache. There is not a cache per query,

@jeremywrowe
jeremywrowe / fast-ember
Last active March 13, 2016 01:19
ember-cli - Improving TTA (Time To App)
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
template_dir = ARGV[0] or fail 'You must supply a template directory'
new_project_dir = ARGV[1] or fail 'You must supply a new project name'
template_dir = File.join(Dir.home, '.ember-cli-cache', template_dir)
fail "The template you are looking for does not exist '#{template_dir}'" unless File.exist? template_dir