Skip to content

Instantly share code, notes, and snippets.

Adam Baldwin evilpacket

Block or report user

Report or block evilpacket

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
@evilpacket
evilpacket / gist:984b344070a001e5c43f
Created Aug 26, 2015
Get list of modules from npm most depended page with jquery
View gist:984b344070a001e5c43f
//https://www.npmjs.com/browse/depended
var links = {};
$('div.container.content a').each(function() {
links[this.href.split('/package/')[1]] = 1
});
Object.keys(links).forEach(function(item) {
console.log(item)
})
View keybase.md

Keybase proof

I hereby claim:

  • I am evilpacket on github.
  • I am adam_baldwin (https://keybase.io/adam_baldwin) on keybase.
  • I have a public key whose fingerprint is 06A7 065F ABC8 39CC 27D3 5E01 D9D0 F356 6734 88E4

To claim this, I am signing this object:

View gist:37df3bf6cd77d9553e6c
var Docker = require('dockerode');
var docker = new Docker({socketPath: '/var/run/docker.sock'});
docker.createContainer({ Image: 'ubuntu', Cmd: ['/bin/ls','/stuff'], "Volumes":{"/stuff": {}} }, function (err, container) {
container.attach({stream: true, stdout: true, stderr: true, tty: true}, function (err, stream) {
stream.pipe(process.stdout);
container.start({"Binds":["/home/vagrant:/stuff"]}, function (err, data) {
console.log(data);
@evilpacket
evilpacket / gist:104f0ffa7fcff6ea6b94
Created May 17, 2014
hapi.js add something to context every request
View gist:104f0ffa7fcff6ea6b94
// Deal with errors
server.ext('onPreResponse', function(request, reply) {
var response = request.response;
// Decorate with session
if (!response.isBoom) {
if (request.response.source && request.response.source.context) {
request.response.source.context.session = {user: request.auth.credentials};
}
return reply();
@evilpacket
evilpacket / index.js
Created Jun 4, 2014
requirebin sketch
View index.js
var AmpersandModel = require('ampersand-model');
var AmpersandView = require('ampersand-view');
var insertCSS = require('insert-css');
var SimpleWebRTC = require('simplewebrtc');
insertCSS('#remoteVideos video { height: 150px;} #localVideo { height: 150px;}');
var PageModel = AmpersandModel.extend({
type: 'page',
props: {
@evilpacket
evilpacket / index.js
Created Jun 4, 2014
requirebin sketch
View index.js
var AmpersandModel = require('ampersand-model');
var AmpersandView = require('ampersand-view');
var insertBootstrap = require('insert-bootstrap')();
var SimpleWebRTC = require('simplewebrtc');
// CSS STUFF
var insertCSS = require('insert-css');
insertCSS('.row {border:dashed; border-color:#cccccc; border-width:1px}');
insertCSS('.slides {border:solid; border-width:1px; height: 400px}');
insertCSS('#remoteVideos video { height: 150px;} #localVideo { height: 150px;}');
@evilpacket
evilpacket / index.js
Created Jun 10, 2014
requirebin sketch
View index.js
//var term = require('term.js')
var AmpersandView = require('ampersand-view');
var insertScript = require('insert-script')('https://rawgit.com/chjj/term.js/master/src/term.js');
/*
var TermView = AmpersandView.extend({
template: '<div>test</div>',
initialize: function () {
//term.open(document.body);
}
@evilpacket
evilpacket / index.js
Created Jun 25, 2014
requirebin sketch
View index.js
var Hammer = require('hammerjs');
var insertCSS = require('insert-css');
//insertCSS('
var AmpersandView = require('ampersand-view');
var AmpersandModel = require('ampersand-model');
var AmpersandCollection = require('ampersand-rest-collection');
var bindTransforms = require('bind-transforms');
@evilpacket
evilpacket / index.js
Created Jun 25, 2014
requirebin sketch
View index.js
var AmpersandView = require('ampersand-view');
var AmpersandModel = require('ampersand-model');
var AmpersandCollection = require('ampersand-collection');
var insertBootstrap = require('insert-bootstrap')();
var insertCSS = require('insert-css');
var marked = require('marked');
insertCSS('.col-sm-6 {border: dashed; border-color: #cccccc; border-width: 1px}');
var PageView = AmpersandView.extend({
View buf.js
// USAGE: node buf.js output_file buffer_size iteration
// Example: node buf.js derp 51200 1000
var fs = require('fs');
var file = process.argv[2];
var size = Number(process.argv[3]);
var thinger = [];
fs.open(file, 'w', function (err, fd) {
You can’t perform that action at this time.