Skip to content

Instantly share code, notes, and snippets.

@myme
myme / lookup-file-fail.txt
Created June 22, 2018 11:39
+lookup/file-fail.txt
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
find-file-name-handler(nil file-equal-p)
file-equal-p("/foo/bar/baz.txt" nil)
(if (file-equal-p fullpath buffer-file-name) (progn (user-error "Already here")))
(let ((fullpath (expand-file-name path))) (if (file-equal-p fullpath buffer-file-name) (progn (user-error "Already here"))) (let* ((insert-default-directory t) (project-root (doom-project-root 'nocache)) (ffap-file-finder (cond ((not (file-directory-p fullpath)) (function find-file)) ((file-in-directory-p fullpath project-root) (function (lambda (dir) (let ((default-directory dir)) (let (projectile-project-name projectile-require-project-root projectile-cached-buffer-file-name projectile-cached-project-root) (let ((file (projectile-completing-read "Find file: " (projectile-current-project-files) :initial-input path))) (find-file (expand-file-name file (projectile-project-root))) (run-hooks 'projectile-find-file-hook))))))) ((function doom-project-browse))))) (find-file-at-point pat
@myme
myme / foo.txt
Created July 23, 2017 21:01
Purescript Node Streams
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor
tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis
eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor.
Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum.
Nam vestibulum accumsan nisl.
@myme
myme / ex.js
Last active October 9, 2015 17:25
browserify({ debug: true })
.require('./src/assets.js')
.transform('babelify')
.bundle()
.on('error', console.error)
.pipe(exorcist('./build/assets.js.map'))
.pipe(fs.createWriteStream('./build/assets.js', 'utf8'));
### Keybase proof
I hereby claim:
* I am myme on github.
* I am myme (https://keybase.io/myme) on keybase.
* I have a public key whose fingerprint is B629 3D25 9181 FEB7 6046 5EEC 1228 F4DE 385A 6C38
To claim this, I am signing this object:
@myme
myme / cscope
Created February 12, 2014 15:11
cscope hook
#!/bin/bash
PIDFILE=.git/cscope.pid
log() {
: # echo "[$$]" $(date +'%F %T'): "$@" >>.git/cscope.log
}
if [ -e $PIDFILE ]; then
PID=$(cat $PIDFILE)
PGRP=$(ps x -o "%p %r" | grep $PID | awk '{print $2}')
import Control.Exception (tryJust)
import Control.Monad (guard)
import Data.Time
import GHC.IO.Handle
import System.Console.GetOpt
import System.Environment
import System.IO.Error
import System.Process
import System.Locale
@myme
myme / audio.js
Last active December 29, 2020 19:15
Testing out Web Audio API with a simple morse code generator.
(function () {
"use strict";
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var morseAlphabet = {
a: '.-',
b: '-...',
c: '-.-.',
aero :: ~/projects/grunt-buster ‹core-refactor› » ./node_modules/.bin/buster-server
Something went horribly wrong. This is most likely a bug, please report at
http://github.com/busterjs/buster/issues
TypeError: Object #<Object> has no method 'add'
at Object.createCombinedResourceSet (/Users/myme/projects/grunt-buster/node_modules/buster/node_modules/buster-server-cli/node_modules/ramp/lib/resource-set-helper.js:31:17)
at Object.<anonymous> (/Users/myme/projects/grunt-buster/node_modules/buster/node_modules/buster-server-cli/node_modules/ramp/lib/ramp-session.js:5:43)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
@myme
myme / blergh.hs
Last active December 22, 2015 15:49
import Data.Text (Text, pack, unpack)
tables :: [Maybe Text]
tables = [ Just $ pack "Foo"
, Just $ pack "Bar"
, Nothing
, Just $ pack "Baz"
]
main :: IO ()
@myme
myme / bar.hs
Last active December 22, 2015 15:48
fromMaybe :: Maybe a -> String
fromMaybe Nothing = "Nothing"
fromMaybe Just a = show a