Skip to content

Instantly share code, notes, and snippets.

@glasser
glasser / flycheck-top-window.el
Last active September 16, 2015 00:34
Preserving Emacs flycheck's error window
(defconst top-window-height 10 "Height to set top window to when splitting")
(defun ensure-top-window ()
(interactive)
(let* ((w (selected-window))
(is-top (and
(eq (window-parent w) (frame-root-window))
(eq (window-top-child (frame-root-window)) w))))
; Make sure we're the top window, and default our height to
; top-window-height. This is a little destructive (loses all window state)
; but generally only happens once per session.
This file has been truncated, but you can view the full file.
[[1,1],1,[true],"bw==","o","ygcA"]
[[2,2],2,[true],"YVsie1wic2VydmVyX2lkXCI6XCIwXCJ9Il0=","a[\"{\\\"server_id\\\":\\\"0\\\"}\"]","SoxWqo5RKk4tKkstis9MiVGyilEyiFGqVYoFAA=="]
[[3,3],3,[true],"YVsie1wibXNnXCI6XCJjb25uZWN0ZWRcIixcInNlc3Npb25cIjpcIlFlcjhYdVdqbk5SaDZnMmRMXCJ9Il0=","a[\"{\\\"msg\\\":\\\"connected\\\",\\\"session\\\":\\\"Qer8XuWjnNRh6g2dL\\\"}\"]","gsjkFqeDxZLz8/JSk0tSgSp0QOqLizPz88AygalFFhGl4Vl5fkEZZulGKT5g3QAA"]
[[4,4],4,[true],"YVsie1wibXNnXCI6XCJhZGRlZFwiLFwiY29sbGVjdGlvblwiOlwibWV0ZW9yX2F1dG91cGRhdGVfY2xpZW50VmVyc2lvbnNcIixcImlkXCI6XCJNYUtEa0J0cnI1bk56M1F2MlwiLFwiZmllbGRzXCI6e1wiY3VycmVudFwiOnRydWV9fSJd","a[\"{\\\"msg\\\":\\\"added\\\",\\\"collection\\\":\\\"meteor_autoupdate_clientVersions\\\",\\\"id\\\":\\\"MaKDkBtrr5nNz3Qv2\\\",\\\"fields\\\":{\\\"current\\\":true}}\"]","QtWdmJIC1Zmcn5MDNAemOTe1JDW/KD6xtCS/tCAlsSQ1PjknMzWvJCy1CGRBMVgP1Fm+id4u2U4lRUWmeX5VxoFlRmDJtMzUnBSgOiugdcmlRUVAzUBOSVFpai3QGQAA"]
[[5,5],5,[true],"YVsie1wibXNnXCI6XCJhZGRlZFwiLFwiY29sbGVjdGlvblwiOlwibWV0ZW9yX2F1dG91cGRhdGVfY
glasser@glasser-lyrid 0 ~/Scratch/issue-4068 $ vagrant init ubuntu/trusty64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
glasser@glasser-lyrid 0 ~/Scratch/issue-4068 $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
@glasser
glasser / gist:114a341e9828849ffc87
Created February 6, 2015 17:32
failing self-tests
authorized: authorized - no username ...
... fail!
=> no-match at tools/tests/authorized.js:143
=> Pattern: : added test
=> Last 100 lines:
2| You must be logged in for that. Try 'meteor login'
cordova-plugins: add cordova plugins ...
... ok (134170 ms)
deploy-auth: deploy - expired credentials ...
... fail!
glasser@perseid 0 ~/Projects/Meteor/testing-cordova $ meteor --release 1.0 create --example localmarket
localmarket: created.
To run your new app:
cd localmarket
meteor
glasser@perseid 0 ~/Projects/Meteor/testing-cordova $ cd localmarket
glasser@perseid 0 ~/Projects/Meteor/testing-cordova/localmarket $ meteor run ios
request: updating npm dependencies -- request...
Error while running for mobile platforms: Error running /Users/glasser/.meteor/packages/meteor-tool/.1.0.35.wql4jh++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/cordova-scripts/cordova.sh
@glasser
glasser / gist:98cfb41154e9a5afb0ec
Created November 4, 2014 23:45
gem install error
ubuntu@ip-10-13-187-68:~$ sudo gem install mosql
ERROR: Could not find a valid gem 'mosql' (>= 0) in any repository
ERROR: Possible alternatives: mosql
ubuntu@ip-10-13-187-68:~$ sudo gem update
Updating installed gems
Nothing to update
ubuntu@ip-10-13-187-68:~$ sudo gem install mosql
ERROR: Could not find a valid gem 'mosql' (>= 0) in any repository
ERROR: Possible alternatives: mosql
ubuntu@ip-10-13-187-68:~$ gem help
@glasser
glasser / keybase.md
Created March 26, 2014 22:13
Keybase verification

Keybase proof

I hereby claim:

  • I am glasser on github.
  • I am glasser (https://keybase.io/glasser) on keybase.
  • I have a public key whose fingerprint is 18A1 3E27 5DF9 37DA 7DA8 E9C5 B5AC B6C4 5396 057D

To claim this, I am signing this object:

@glasser
glasser / README.md
Last active December 25, 2015 01:18
Demonstrates why we need an error handler on proxySocket

To reproduce:

  • Run any websocket server. eg, 'meteor create x; cd x; meteor'. Now we have a websocket server on port 3001. (Meteor will tell you port 3000, but that's meteor's use of http-proxy; 3001 is the unproxied version.)

  • Run the above script.

  • Send lots of data through the proxy to the websocket. eg, install https://github.com/progrium/wssh and run

    yes | wssh localhost:6767/websocket

@glasser
glasser / npm-cache-test.sh
Last active December 16, 2015 06:29
Shell script showing how the NPM cache can be corrupted
#!/bin/bash
set -eux
NPM=/usr/local/bin/npm
TESTDIR=`mktemp -d -t npm-test-XXXXXXXX`
cd $TESTDIR
echo "Deleting your local NPM cache"
@glasser
glasser / cat_test.js
Created September 19, 2012 19:37
Node 0.8 child_processes can't use /dev/stdin or /proc/self/fd/N
var spawn = require('child_process').spawn;
var cp = spawn('cat', ['/proc/self/fd/0']);
cp.stdout.setEncoding('utf8');
cp.stdout.on('data', function (chunk) {
console.log("child stdout: ", chunk);
});
cp.stderr.setEncoding('utf8');