Skip to content

Instantly share code, notes, and snippets.

Sean Coates scoates

Block or report user

Report or block scoates

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am scoates on github.
  • I am scoates (https://keybase.io/scoates) on keybase.
  • I have a public key whose fingerprint is 8A45 6450 4355 2F7B FB92 5422 E905 36DD 957A 42BE

To claim this, I am signing this object:

@scoates
scoates / 0_reuse_code.js
Created Jul 24, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View README.md

WHAT?

<?php

function machine_forget(&$data) {
    $data = null;
}

$answer = 42;
@scoates
scoates / salt_roots_sshd-mfa_init.sls
Created Mar 13, 2015
SSH + MFA (with Google Authenticator) on Debian Wheezy
View salt_roots_sshd-mfa_init.sls
include:
# for backports
- apt
openssh6.6:
pkg.installed:
# backports; this number *will* change
- pkgs:
- openssh-server: 1:6.6p1-4~bpo70+1
- openssh-client: 1:6.6p1-4~bpo70+1
@scoates
scoates / timeline
Created Apr 15, 2015
Measure the time delta between lines in stdout
View timeline
#!/usr/bin/env python
import time
from sys import stdin, stdout, argv, exit
try:
if argv[1] == 'help' or argv[1] == '--help' or argv[1] == '-h':
print "%s: times each line of stdin." % argv[0]
print " Optional parameter is a float of a threshold. (defaults to 2.0)"
exit(255);
View highstate_pile.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
based on https://raw.githubusercontent.com/saltstack/salt/develop/tests/eventlisten.py
'''
# Import Python libs
from __future__ import print_function
import optparse
View custom_readline.js
var readline = require('readline');
module.exports = readline;
readline.Interface.prototype.cursorToEnd = function() {
// place the cursor at the end of the current line
this.output.write(
'\x1b[0G\x1b[' + (
this._promptLength + this.line.length
) + 'C'
View Node REPL stdin?
sarcasm:~/src/tmp$ cat repl.js
repl = require("repl");
repl.start("testrepl> ");
sarcasm:~/src/tmp$ node repl.js
testrepl> 5+5
10
testrepl> sarcasm:~/src/tmp$ echo "5+5" | node repl.js
node.js:63
throw e;
View gist:615392
browser
.chain
.session()
.and(function (browser) {
browser
.chain
.open('/')
.assertElementPresent('link=Log out')
.clickAndWait('link=Log out')
.assertElementPresent('link=Log in')
View gist:615412
browser
.chain
.session()
.and(function (browser) { // log out
try {
browser
.open('/')
.assertElementPresent('link=Log out')
.clickAndWait('link=Log out')
.assertElementPresent('link=Log in')
You can’t perform that action at this time.