Skip to content

Instantly share code, notes, and snippets.

Trent Mick trentm

Block or report user

Report or block trentm

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 enter-password.js
var stdin = process.stdin
, stdio = process.binding("stdio")
stdio.setRawMode()
// let the data flow.
// stdin is "paused" initially.
stdin.resume()
var password = ""
stdin.on("data", function (c) {
View no.de.sh
#!/bin/bash
SERVER=https://api.no.de
SCRIPT="$0"
if [ ${SCRIPT:0:1} == "/" ]; then
SCRIPT="$(basename -- "$SCRIPT")"
fi
main () {
cmd=${1-help}
@glennblock
glennblock / fork forced sync
Created Mar 4, 2012
Force your forked repo to be the same as upstream.
View fork forced sync
git fetch upstream
git reset --hard upstream/master
@trentm
trentm / magic.js
Created Mar 24, 2015
compressed file type detection using magic numbers. Wrote it. Don't need it right now.
View magic.js
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at http://smartos.org/CDDL
*
View manual-sdcadm-self-update.sh
updates-imgadm get-file -o latest-sdcadm.sh $(updates-imgadm list name=sdcadm --latest -H -o uuid)
bash latest-sdcadm.sh
View smartos-node-v4.x-binaries-issues.md

Issues with nodejs.org binaries for SmartOS users

Description of the problem

Node v4.x.y binaries have been built with compilers at versions greater than the ones used to build packages in the LTS pkgsrc repositories. They've been built with gcc 4.9 and gcc 4.8, when the compiler used to build packages from the 2014Q4 pkgsrc repository is gcc 4.7.3.

As a consequence, these node v4.x.y binaries downloaded from nodejs.org have

@trentm
trentm / output.txt
Created Feb 23, 2016
hack to node-tape to get timestamps on TAP test results
View output.txt
ok 41 [2016-02-23T19:45:28.419Z] createMachine
ok 42 [2016-02-23T19:45:28.419Z] createMachine 201 statusCode
ok 43 [2016-02-23T19:45:28.419Z] createMachine Location header
ok 44 [2016-02-23T19:45:28.419Z] createMachine body: 7d609b77-7821-459d-894f-637f9d5a3e05
ok 45 [2016-02-23T19:45:28.420Z] headers ok
ok 46 [2016-02-23T19:45:28.420Z] headers allow-origin
ok 47 [2016-02-23T19:45:28.420Z] headers allow-methods
ok 48 [2016-02-23T19:45:28.421Z] headers date
ok 49 [2016-02-23T19:45:28.421Z] headers request-id
ok 50 [2016-02-23T19:45:28.422Z] headers response time
@trentm
trentm / ben-arrayiter.js
Last active Apr 12, 2016
Slow JavaScript array iter
View ben-arrayiter.js
var ben = require('ben');
var servers = [];
for (var i = 0; i < 1000; i++) {
servers.push({"uuid": "blah", "hostname": "blah", "vms": {"foo": "blah"}});
}
var forMs = ben(function () {
var filteredServers = [];
for (var i = 0; i < servers.length; i++) {
You can’t perform that action at this time.