Skip to content

Instantly share code, notes, and snippets.

View jxson's full-sized avatar

Jason Campbell jxson

View GitHub Profile
@mattsacks
mattsacks / preventHistorySwipe.js
Created May 22, 2013 22:46
Prevent back/forward gestures when scrolling an element left/right on OS X
// prevent back/forward gestures when scrolling an element left/right on OS X
var preventHistorySwipe = function(element) {
// not even on the right platform bro
if (navigator.userAgent.indexOf('Macintosh') === -1) return;
element.addEventListener('mousewheel', function(e) {
var x = e.wheelDeltaX;
// scrolling up or down? then i don't give a shit
if (x === 0) return;

Recipe for customizing a SmartoOS image and cloning it

1. Create base image

1.1. Download and install the base image:

[root@00-0c-29-aa-24-ba ~]# imgadm list
UUID                                  NAME             VERSION  OS       PUBLISHED
9eac5c0c-a941-11e2-a7dc-57a6b041988f  base64           13.1.0   smartos  2013-04-26T15:17:57Z
@shovon
shovon / README.md
Last active April 18, 2019 08:37
An install script for LLVM and Clang v3.2.

Installing LLVM and Clang v3.2 on OS X

I'm assuming you need this version for Emscripten.

Don't worry, this script will not override your current installation of LLVM and Clang.

Be sure that you have:

  • read this README file
  • read this README file
@ryanblock
ryanblock / @ryan tweetbot regex.md
Created August 29, 2012 02:27
How Tweetbot and regex made my Twitter replies usable again (filed under: #wrongryan)

How Tweetbot and regex made my Twitter replies usable again

As it turns out, most normal humans are incapable of learning to use Twitter @ replies. And in case you don't follow me on Twitter: yes, my handle (@ryan) gets a lot of erroneous mentions. (The most amusing, random ones I've even taken to retweeting under the #wrongryan hashtag.)

Then Tweetbot -- and its ability to use regex as Twitter filters -- came along. Here's how the Tapbots guys and some regular expressions single-handedly made my Twitter replies usable again.

Notes and caveats

  • I'm not a regex expert. Far from it. I suck at regex, actually. If you have suggestions for improvements, please leave them below!
  • Some regex may look a little sloppy, but in actuality was written because TweetBot for Mac's regex filter support is very early, and things like repeats (expression{3,}) are buggy. So everything below should work without crashing Tweetbot for iPhone, iPad, and Mac.
  • Obvious, but not everyone should make use of every filter b
@AndreasMadsen
AndreasMadsen / WhatIHaveDone.md
Last active February 13, 2022 16:15
Playing with smartos
@paf31
paf31 / W.lhs
Last active November 3, 2022 13:26
Algorithm W
## Principal type-schemes for functional programs
**Luis Damas and Robin Milner, POPL '82**
> module W where
> import Data.List
> import Data.Maybe
> import Data.Function
@joaoneto
joaoneto / login.test.js
Created March 13, 2013 13:49
Login session test with mocha
var request = require('supertest'),
should = require('should'),
app = require('../server');
var Cookies;
describe('Functional Test <Sessions>:', function () {
it('should create user session for valid user', function (done) {
request(app)
.post('/v1/sessions')

MDB is unlike most debuggers you've experienced.

It is not a source level debugger like gdb or lldb or even Node's builtin debugger

Generally used for postmortem analysis.

Postmortem is for Production and Development

We operate mostly on core files, though you can attach to running processes as well.

@max-mapper
max-mapper / helloworld.js
Created November 27, 2012 06:55
droneduino
var serialport = require('node-serialport')
var sp = new serialport.SerialPort("/dev/ttyO3", {
parser: serialport.parsers.raw,
baud: 9600
})
sp.on('data', function(chunk) {
console.log(chunk.toString('hex'), chunk.toString(), chunk)
})