Skip to content

Instantly share code, notes, and snippets.

@shawninder
shawninder / streaming js to browserify
Created March 31, 2016 16:21
Example of streaming data to browserify instead of passing it the path to a file
'use strict'
var Stream = require('stream')
var browserify = require('browserify')
var st = new Stream.Readable()
var js = '// A string of javascript with requires'
st.push(js, 'utf8')
st.push(null)
var b = browserify(st).bundle()
$ appium
[Appium] Welcome to Appium v1.5.1 (REV e1c84bae37afae282f39b91025435c3717e6d0ab)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"browserName":"","appium-version":"1.3","platformName":"iOS","platformVersion":"9.1","deviceName":"iPhone 5","app":"/Users/shawn/Desktop/vigour-native.app"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"browserName":"","appium-version":"1.3","platformName":"iOS","platformVersion":"9.1","deviceName":"iPhone 5","app":"/Users/shawn/Desktop/vigour-n...
[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium] browserName: ''
[Appium] appium-version: '1.3'
[Appium] platformName: 'iOS'
@shawninder
shawninder / index.js
Last active April 15, 2016 09:06
requirebin sketch
var postcss = require('postcss')
var cssnext = require('postcss-cssnext')
var test = require('tape')
var input = 'body { color: rebeccapurple; }'
var expected = 'body { color: rgb(102, 51, 153); }'
test('cssnext', function (t) {
t.plan(1)
postcss([cssnext]).process(input).then(function (result) {
'use strict'
var Stream = require('stream')
var test = require('tape')
var browserify = require('browserify')
/**
* This plugin waits until browserify is done going through the require tree,
* then adds "SUCCESS!" to the array passed in as `results` in the options object
*/
@shawninder
shawninder / index.js
Created April 15, 2016 15:22
requirebin sketch
var browserify = require('browserify')
'use strict'
var Stream = require('stream')
var test = require('tape')
var browserify = require('browserify')
var through = require('through2')
/**
* This plugin waits until browserify is done going through the require tree,
* then adds "SUCCESS!" to the array passed in as `results` in the options object

Last Week Tonight Feb 12 2017 excerpt

On February 12 2017, on his show Last Week Tonight, John Oliver said the following (video):

We all need to commit to defending the reality of facts, but it's going to take work. As we've already seen, protests, calls to legislators and lawsuits are effective ways to try an drag the administration back to reality, but this needs to go down to a personal level as well.

We should make extra effort on social media to try and verify stories before passing them on, especially if they confirm our preexisting biases. Ask questions of yourself, like:

  • Is this a source I know and recognize?
  • Has anyone fact-checked this?
  • Does it link to primary sources, and do those sources match what the story says?
$ sbt run
[info] welcome to sbt 1.4.6 (AdoptOpenJDK Java 11.0.9.1)
[info] loading settings for project lila-ws-build-build-build from metals.sbt ...
[info] loading project definition from /Users/shawn/git/shawninder/lila-ws/project/project/project
[info] loading settings for project lila-ws-build-build from metals.sbt ...
[info] loading project definition from /Users/shawn/git/shawninder/lila-ws/project/project
[success] Generated .bloop/lila-ws-build-build.json
[success] Total time: 0 s, completed Jan. 18, 2021, 4:02:40 p.m.
[info] loading settings for project lila-ws-build from metals.sbt,plugins.sbt ...
[info] loading project definition from /Users/shawn/git/shawninder/lila-ws/project
sbt:lila-ws> run
[warn] Compile / run / javaOptions will be ignored, Compile / run / fork is set to false
[info] running lila.ws.Boot
SLF4J: A number (1) of logging calls during the initialization phase have been intercepted and are
SLF4J: now being replayed. These are subject to the filtering rules of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#replay
INFO r.api.Driver [clients-akka.actor.default-dispatcher-3] [Supervisor-1] Creating connection: Connection-1
INFO r.c.a.MongoDBSystem [reactivemongo-akka.actor.default-dispatcher-4] [Supervisor-1/Connection-1] Starting the MongoDBSystem
INFO r.core.netty.Pack [reactivemongo-akka.actor.default-dispatcher-4] Netty EPoll successfully loaded (shaded: true)
INFO r.core.netty.Pack [reactivemongo-akka.actor.default-dispatcher-4] Instantiated reactivemongo.core.netty.Pack
@shawninder
shawninder / planet4-docker-compose_makeDev.log
Created January 19, 2021 19:59
This is what I get when running `GIT_REF="fix/rsync-omit-times" make dev` in the `greenpeace/planet4-docker-compose` repo
This file has been truncated, but you can view the full file.
Hosts file already configured
Starting traefik ... done
Starting redis ... done
Starting db ... done
Starting php-fpm ... done
Starting openresty ... done
Starting elasticsearch ... done
Starting P4 Wordpress docker-compose stack.
Note, this may take up to 10 minutes on the first run!