Instantly share code, notes, and snippets.

View mwdes.sh
#!/bin/bash
#
# Copyright (c) 2015 BITPlan GmbH
#
# see LICENSE
#
# WF 2015-10-18
#
# Mediawiki docker image entrypoint script
#
View Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "terminal-notifier"
gem "typhoeus"
View Makefile
update_server_password:
./update_la_pwd.exp $LI_IP $PASSWORD
View LCInstanceGen.sh
#!/bin/bash
REGION=${REGION:-"ap-southeast-2"}
INSTANCE='HAL-TheBigPHPMachine'
SCRIPT_EXT=-$REGION$INSTANCE
cp StartEC2Instances.py.template StartEC2Instances$SCRIPT_EXT.py
sed -i '' 's/__REGION__/'${REGION}'/g' StartEC2Instances$SCRIPT_EXT.py
sed -i '' 's/__INSTANCE__/'${INSTANCE}'/g' StartEC2Instances$SCRIPT_EXT.py
zip StartEC2Instances.zip StartEC2Instances$SCRIPT_EXT.py
View model.go
package sqlite
import (
"fmt"
"os"
"sync"
"time"
"github.com/golang/glog"
"github.com/jinzhu/gorm"
View Dockerfile
FROM golang:1.8
MAINTAINER james.meldrum@maxwellforest.com
RUN mkdir -p /go/src/github.com/maxwellforest/onefill
WORKDIR /go/src/github.com/maxwellforest/onefill
COPY . /go/src/github.com/maxwellforest/onefill
RUN go get -u github.com/golang/dep/cmd/dep
RUN dep ensure
View gist:a5de91aac50b8b3b0254cee56f3615ed
#!/usr/bin/env node
let success = 'success';
let failure = 'failure';
var callCount = 0;
async function runSyncAsync() {
console.log('runSyncAsync');
let resCallCount = 0;
let success = 4;
View gist:03a2fc316e59515a06241f9d6b804ebf
#!/usr/bin/env node
let success = 'success';
let failure = 'failure';
async function runEngine() {
console.log('runEngine');
var report = await run1();
return report; // Important! Otherwise it will return some bizarre object
// { '0': {},
View compressVideo.swift
static func compressVideo(inputURL: URL, outputURL: URL) -> Promise<URL> {
let videoAsset = AVURLAsset(url: inputURL, options: nil)
return Promise<URL> { fulfill, reject in
guard let videoTrack = videoAsset.tracks(withMediaType: AVMediaTypeVideo).first else {
reject(AVServiceError.noDataFound)
return
}
guard let audioTrack = videoAsset.tracks(withMediaType: AVMediaTypeAudio).first else {
reject(AVServiceError.noDataFound)
return
View Blog.js
// TODO Copy over all support directories as well
// TODO Replace returning promises with async / await
// TODO Decide if it's worth making an extension to Vue.js
// TODO Decide how Markdown will interact with custom Vue.js components
// Global map of Markdown syntax to Vue.js components on a page-by-page basis with sane defaults?
// Unit testing, project setup and maintenance as an open source concern
#!/usr/bin/env node
var fs = require('fs');