This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 info it worked if it ends with ok | |
1 verbose cli [ 'node', | |
1 verbose cli '/usr/local/bin/npm', | |
1 verbose cli 'install', | |
1 verbose cli 'karma-phantomjs-launcher', | |
1 verbose cli 'karma-jasmine', | |
1 verbose cli 'grunt-karma', | |
1 verbose cli '--save-dev' ] | |
2 info using [email protected] | |
3 info using [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
) | |
func environGet(key string, otherwise string) int { | |
v := os.Getenv(key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Combining: https://github.com/iron/body-parser/blob/master/examples/bodyparser.rs | |
// with: https://github.com/iron/router/blob/master/examples/simple.rs | |
extern crate iron; | |
extern crate router; | |
extern crate bodyparser; | |
extern crate persistent; | |
extern crate rustc_serialize; | |
use iron::prelude::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import importlib | |
import pkgutil | |
def import_submodules(package, recursive=True): | |
""" Import all submodules of a module, recursively, including subpackages | |
:param package: package (name or actual module) | |
:type package: str | module | |
:rtype: dict[str, types.ModuleType] | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the relevant components of my Angular Ionic app: | |
### View | |
<!-- language: lang-html --> | |
<body ng-app="ionic_appname"> | |
<ion-nav-view></ion-nav-view> | |
<ion-nav-view name="errorsView" title="Errors"></ion-nav-view> | |
### Routing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
describe('module: main, controller: FooCtrl', function () { | |
// load the controller's module | |
beforeEach(module('main')); | |
// load all the templates to prevent unexpected $http requests from ui-router | |
beforeEach(module('ngHtml2Js')); | |
// instantiate controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from 'fs'; | |
import * as path from 'path'; | |
// Trivial to extend with `includeDirs`, just follow same pattern | |
function fileList(dir, excludeDirs?) { | |
return fs.readdirSync(dir).reduce(function (list, file) { | |
const name = path.join(dir, file); | |
if (fs.statSync(name).isDirectory()) { | |
if (excludeDirs && excludeDirs.length) { | |
excludeDirs = excludeDirs.map(d => path.normalize(d)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from os import path | |
from sys import argv, stderr | |
import bpy | |
def main(): | |
args = argv[argv.index('--') + 1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib2 | |
def get_ubuntu_ami(region='ap-southeast-2', arch='64-bit', root_store='ebs', codename='trusty', version='current'): | |
# Just a quick hack! | |
s = urllib2.urlopen( | |
'http://cloud-images.ubuntu.com/{codename}/{version}/'.format(codename=codename, version=version) | |
).read().replace(' ', '') | |
find = '''<tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.3 | |
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added | |
RUN addgroup -S mongodb && adduser -S -G mongodb mongodb | |
RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \ | |
&& apk update \ | |
&& apk add openrc \ | |
&& apk add mongodb@testing |