Skip to content

Instantly share code, notes, and snippets.

View jamesdixon's full-sized avatar

James Dixon jamesdixon

View GitHub Profile
@clhenrick
clhenrick / README.md
Last active March 3, 2025 23:02
PostgreSQL & PostGIS cheatsheet (a work in progress)
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active March 12, 2025 04:26
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.

@rafaelveloso
rafaelveloso / plv8-javascript-modules-loading.sql
Last active December 6, 2019 14:21
How to load Javascript modules into postgres using plv8
/******************************************************************************
How to load Javascript modules into postgres
******************************************************************************/
CREATE EXTENSION IF NOT EXISTS plv8
/******************************************************************************
First step is download the Javascript module file
Example with undescore-min and node-jpath
******************************************************************************/
@Samsinite
Samsinite / array.js
Created January 26, 2015 04:47
Array transform for ember-data
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
serialize: function(deserialized) {
return !!deserialized ? deserialized.toArray() : null;
},
deserialize: function(serialized) {
return Ember.A(serialized);
@danharper
danharper / 1-sleep-es7.js
Created February 8, 2015 16:55
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()
@lukemelia
lukemelia / index.js
Created April 4, 2015 04:49
ember-cli livereload, ssl and nginx (file from an in-repo addon)
'use strict';
/*
ember-cli's live-reload doesn't work out of the box for our configuration
because we run in local dev using www.yapp.dev over SSL. We use nginx to
terminate SSL and reverse proxy appropriate requests to ember-cli.
A configuration that gets live-reload working is implemented by this
addon plus nginx rules. This addon includes a script tag in index.html
as defined by the `contentFor` method below. Our standard nginx config
@simenbrekken
simenbrekken / deployment.sh
Last active January 25, 2016 22:17
Codeship Azure Website Custom Deployment Script
# $AZURE_REPO_URL needs to be set in your projects Variables section
# and include both username and password, e.g: https://username:[email protected]:443/site.git
# Clone Azure repository
git clone $AZURE_REPO_URL ~/azure
cd ~/azure
# Replace repository contents
rsync --archive --delete --exclude ".*" ~/clone/public/ .
@rhys-vdw
rhys-vdw / paginate.coffee
Last active March 8, 2016 16:07
Poor man's knex/bookshelf pagination
Promise = require 'bluebird'
defaultPageSize = 20
paginate = (knex) -> (query, paginationOptions, options) ->
if query.fetchAll?
model = query
query = model.query()
@SaladFork
SaladFork / _instructions.md
Last active April 14, 2016 16:52
Mocha Reporter (+blanket.js)
  1. Put reporter.js in tests/helpers/reporter.js
  2. Change tests/test-helper.js to look like the attached
  3. Put test-container-styles.css in vendor/ember-cli-mocha to override the default
  4. Stop your server and restart (it doesn't watch vendor/ by default)
@ryanlabouve
ryanlabouve / ember-deploy-notes.md
Last active January 27, 2017 09:48
Ember Deploy Notes (s3 and redis)
// Notes from our previous deploy strategy

CI for Ember-CLI App using

Using ember-cli-deploy we will deploy our Ember(-cli) app to S3 (and cloudfront), Redis via github and codeship.

Since skill-set's may vary, set's start by breaking this down at a high level: