# Example 1 - Update current query's `tab` value
Starting URL: https://github.com/justsml?tab=repositories
Transform W/: {tab: 'activity'}
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
#!/bin/bash | |
# Upload a sample to VirusTotal and pretty print the report. All in a handy alias. | |
# | |
# Dependecies: | |
# | |
# * python > 2.7 | |
# * pip install Pygments==1.4 | |
# * curl | |
# * VirusTotal API 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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: disable-transparent-hugepages | |
# Required-Start: $local_fs | |
# Required-Stop: | |
# X-Start-Before: mongod mongodb-mms-automation-agent | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Disable Linux transparent huge pages | |
# Description: Disable Linux transparent huge pages, to improve |
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
#!/bin/bash | |
#Author: Dan Levy <Dan@DanLevy.net> | |
#Credits: docker - https://github.com/docker/docker/blob/master/hack/install.sh | |
command_exists() { | |
command -v "$@" > /dev/null 2>&1 | |
} | |
lsb_dist='' | |
dist_version='' |
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
var tap = require('tap'); | |
var locationify = require('..'); | |
tap.test('full URLs', function (t) { | |
t.similar(locationify('https://github.com/justsml#top'), { | |
host: 'github.com', | |
hash: '#top', | |
path: '/justsml', | |
}); | |
// call t.end() when you're done |
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
// Promises are great, but bluebird covers :allthethings | |
var Promise = require('bluebird'); | |
var appContext = {ready: false, error: false}; | |
const INVALID_CTX = {ready: false, error: true, message: 'App or User not initialized'}; | |
// Bluebird-ify around `fetch` API | |
function getUser(username) {return Promise.resolve('users/' + username + '.json').then(fetch);} | |
function initApp(username) { | |
// Use bluebird to do some real-world-ish code: |
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
#/bin/bash | |
set -e | |
# Tested on Mac OSX | |
# Local IP changes on every network you connect to (via dhcp) | |
export LOCAL_IP=`ifconfig en0 | grep 'inet ' | awk '{ print $2; }' 2>/dev/null` | |
# This is the 'Bridge' (virtual switch) from virtualbox - only visible from your local PC | |
export BRIDGE_IP=`ifconfig vboxnet0 | grep 'inet ' | awk '{ print $2; }' 2>/dev/null` | |
export DOCKER_HOST_IP=`docker-machine ip default` |
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
#!/bin/bash | |
# Clone of Capture Screen Region on Mac OSX (map to similar Cmd-Ctrl-Shift-4) | |
# *** Requirements *** | |
# shutter - `apt-get install shutter` | |
# copyq - download from https://github.com/hluk/CopyQ/releases | |
shutter --select --no_session --exit_after_capture --output=/tmp/screenshot-surrent.png | |
copyq write image/png - < /tmp/screenshot-surrent.png && copyq select 0 | |
rm /tmp/screenshot-surrent.png |
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
var ctx = {}; | |
var _ = require('lodash'); | |
var assert = require('assert'); | |
var Promise = require('bluebird'); | |
var mongodb = Promise.promisifyAll(require('mongodb')); | |
var MongoClient = Promise.promisifyAll(mongodb.MongoClient); | |
var Collection = Promise.promisifyAll(mongodb.Collection); | |
const MONGO_BOOLEAN_TYPE = { 'type': 'Boolean', default: null }; | |
const MONGO_NUMBER_TYPE = { 'type': 'Number', default: null }; |
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 node:5.10.1 | |
MAINTAINER Dan Levy <Dan@DanLevy.net> | |
EXPOSE 3000 | |
ADD https://raw.githubusercontent.com/justsml/system-setup-tools/master/home-scripts/.bashrc /root/.bashrc | |
ADD https://raw.githubusercontent.com/justsml/system-setup-tools/master/home-scripts/.bash_aliases /root/.bash_aliases | |
COPY . /app/ | |
WORKDIR /app | |
CMD ["npm", "start"] |