Skip to content

Instantly share code, notes, and snippets.

View raymond-w-ko's full-sized avatar
🧐
I'm coding.

Raymond W. Ko raymond-w-ko

🧐
I'm coding.
View GitHub Profile
const FS = require("fs")
const assert = require("assert")
const origSourceMap = JSON.parse(FS.readFileSync("./orig/index.js.map"))
const sections = origSourceMap.sections
assert.equal(sections.length, 1)
const sm = sections[0].map
const lineStart = sections[0].offset.line
const prefix = ";".repeat(lineStart)
Error detected while processing function <SNR>138_import[11]..<SNR>138__import[20]..<SNR>138__build_module:
line 18:
E924: can't have both a "self" dict and a partial: <SNR>138_load
Error detected while processing function 128[2]..<SNR>116_make:
line 2:
E924: can't have both a "self" dict and a partial: <SNR>119_make
@raymond-w-ko
raymond-w-ko / gist:691e033f4c530cb61526
Created March 17, 2015 02:31
Clojure string escapes galore
(defn create-fuzzy-regex [s]
(-> s
;; special regex
(clojure.string/replace "?" "\\?")
(clojure.string/replace "*" "\\*")
(clojure.string/replace "+" "\\+")
(clojure.string/replace "[" "\\[")
(clojure.string/replace "]" "\\]")
(clojure.string/replace "$" "\\$")
(clojure.string/replace #"\s*\(\s*" (clojure.string/re-quote-replacement "\\s*\\(\\s*"))
@raymond-w-ko
raymond-w-ko / vmware-fix-for-linux-3.19.0.patch
Created February 9, 2015 20:52
vmware-patch fix for VMware 11.0.0 and Linux 3.19.0
diff -rupN vmware-patch.a/PKGBUILD vmware-patch/PKGBUILD
--- vmware-patch.a/PKGBUILD 2015-02-07 19:54:31.000000000 -0500
+++ vmware-patch/PKGBUILD 2015-02-09 15:47:12.793839736 -0500
@@ -12,6 +12,8 @@ depends=('fuse' 'gtkmm' 'linux-headers')
options=('!emptydirs')
install=$pkgname.install
source=('vmware-patch' 'vmware-unpatch' 'common-functions.sh' 'vmware.service' 'vmware-usbarbitrator.service' 'vmware-workstation.service'
+ # Workstation 11.0.0 / Player (Plus) 7.0.0
+ 'vmnet-11.0.0-3.19.patch'
# Workstation 10.0.5 / Player (Plus) 6.0.5
@raymond-w-ko
raymond-w-ko / vmware-patch-linux-3.17
Created October 7, 2014 13:46
Patch for vmware-patch in AUR due to linux 3.17 update
diff -rupN vmware-patch.old/PKGBUILD vmware-patch.new/PKGBUILD
--- vmware-patch.old/PKGBUILD 2014-08-22 09:51:26.000000000 -0400
+++ vmware-patch.new/PKGBUILD 2014-10-07 09:39:07.496993396 -0400
@@ -3,7 +3,7 @@
pkgname=vmware-patch
pkgver=10.0.3
-pkgrel=3
+pkgrel=4
pkgdesc="A post-install configuration solution for VMware Workstation and Player (Plus)"
@raymond-w-ko
raymond-w-ko / gist:cbc866e8acb220dd94bf
Created June 9, 2014 13:55
fix for vmware-patch due to Linux kernel 3.15 being released
diff -rupN vmware-patch/PKGBUILD vmware-patch.fixed/PKGBUILD
--- vmware-patch/PKGBUILD 2014-06-06 11:54:47.000000000 -0400
+++ vmware-patch.fixed/PKGBUILD 2014-06-09 09:45:06.424522425 -0400
@@ -13,9 +13,10 @@ options=('!emptydirs')
install=$pkgname.install
source=('vmware-patch' 'vmware-unpatch' 'vmware.service' 'vmware-usbarbitrator.service' 'vmware-workstation.service'
# Workstation 10 / Player (Plus) 6
- 'vmci-10.0.2-10.0.1-10.0.0-6.0.2-6.0.1-6.0.0-3.14.patch'
+ 'vmci-10.0.2-10.0.1-10.0.0-6.0.2-6.0.1-6.0.0-3.15-3.14.patch'
'vmmon-10.0.2-10.0.1-10.0.0-6.0.2-6.0.1-6.0.0-3.14.patch'
@raymond-w-ko
raymond-w-ko / indent.lua
Created December 4, 2012 20:15
better lua.vim indent file showcase
function foo(bar)
a = {}
end
function foo(bar)
a = {
stuff,
stasdtas,
asdf
}
@raymond-w-ko
raymond-w-ko / testcase-for-561.vim
Created June 20, 2012 16:26
Testcase Showing Bug in VIM 7.3.561
set nocompatible
function! TestCompleteFunc(findstart, base)
if a:findstart
let index = col('.') - 2
let line = getline('.')
while 1
if (index == -1)
break
endif