Skip to content

Instantly share code, notes, and snippets.

View OliverJAsh's full-sized avatar

Oliver Joseph Ash OliverJAsh

View GitHub Profile
@OliverJAsh
OliverJAsh / utils.js
Last active July 7, 2021 20:53
JS utils
const head = array => array[0];
const zip = (...arrays) => (
head(arrays).map((value, index) => arrays.map(otherArray => otherArray[index]))
);
const map = (collection, mapFn) => (
Object.keys(collection).map(key => mapFn(collection[key], key))
);
const reduce = (collection, reduceFn, seed) => (
Object.keys(collection).reduce((acc, key) => {
const value = collection[key];
@OliverJAsh
OliverJAsh / a.rb
Created June 25, 2015 17:15
DI for SystemJS
export default class Injector {
constructor() {
this.loader = new System.constructor();
this.loader.config({
baseURL: System.baseURL,
defaultJSExtensions: true,
transpiler: System.transpiler,
paths: System.paths,
map: System.map,
// Map is transformed to packages
@OliverJAsh
OliverJAsh / a.rb
Created June 25, 2015 17:15
DI for SystemJS
/Users/OliverJAsh/Development/frontend/static/src/javascripts/test/helpers/injector.js
@OliverJAsh
OliverJAsh / bundle.js
Created June 17, 2015 19:02
jspm bundle SFX format
/*eslint-env node*/
var jspm = require('jspm');
var builder = new jspm.Builder();
builder.buildSFX('main.js', 'build.js', { sfxFormat: 'amd' });
System.config({
"defaultJSExtensions": true,
"transpiler": "babel",
"babelOptions": {
"optional": [
"runtime"
]
},
"paths": {
"github:*": "jspm_packages/github/*",
@OliverJAsh
OliverJAsh / git-merge-pr
Created June 12, 2015 12:57
git merge-pr
#!/bin/bash
# Usage: git merge-pr [<branch-name>]
# ln -s ~/Desktop/git-merge-pr /usr/local/bin
#
# Merge the PR for a given branch, and delete branches (local and remote)
# afterwards.
# Defaults to current branch.
set -e
BRANCH=`git rev-parse --abbrev-ref HEAD`
System.config({
"baseURL": "/",
"transpiler": "traceur",
"paths": {
"*": "*.js",
"github:*": "jspm_packages/github/*.js"
}
});
System.config({
{
"tags": {
"commercial": [
"media-network/series/brand-marketing",
"media-network/series/organic-marketing",
"teacher-network/series/schools-of-the-future",
"teacher-network/series/pe-and-school-sport",
"higher-education-network",
"social-care-network",
"media-network/series/changing-business",
import sbt._
import Keys._
import org.scalatra.sbt._
import org.scalatra.sbt.PluginKeys._
import com.mojolly.scalate.ScalatePlugin._
import ScalateKeys._
object CiapiBuild extends Build {
val Organization = "com.example"
val Name = "ci-api"
import sbt._
import Keys._
import org.scalatra.sbt._
import org.scalatra.sbt.PluginKeys._
import com.mojolly.scalate.ScalatePlugin._
import ScalateKeys._
object CiapiBuild extends Build {
val Organization = "com.example"
val Name = "ci-api"