This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<root> | |
<devicevendordef> | |
<vendorname>TOPRE</vendorname> | |
<vendorid>0x0853</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>HHKB_PRO2</productname> | |
<productid>0x0100</productid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ForthInterpreter | |
attr_reader :stack, :dict | |
def initialize | |
@stack = [] | |
@dict = { | |
:"." => Proc.new { print @stack.pop }, | |
:".s" => Proc.new { puts @stack }, | |
:cr => Proc.new { puts }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# the stack | |
$stack = [] | |
def pop() $stack.pop || ufe end | |
def push(f) $stack<<f end | |
# poor man's Exception class | |
def ufe() raise("Stack underflow") end | |
# lambda constructor helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "windows.bi" | |
Dim shared as HANDLE hook | |
function LowLevelKeyboardProc(byval nCode as long, byval wParam as WPARAM, byval lParam as LPARAM) as LRESULT | |
if nCode < 0 then | |
return CallNextHookEx(NULL, nCode, wParam, lParam) | |
end if | |
var s = cptr(LPKBDLLHOOKSTRUCT, lParam) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test | |
def initialize | |
@a = 100 | |
end | |
a = 100 | |
def test1 | |
a | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- hs.logger.setGlobalLogLevel('debug') | |
local logger = hs.logger.new('focus') | |
hs.timer.doEvery(3, function() | |
local current = hs.mouse.getCurrentScreen() | |
-- hs.rawprint(current) | |
if current and current ~= hs.screen.mainScreen() then | |
local windows = hs.window.orderedWindows() | |
for _, l in ipairs(windows) do | |
if l:screen() == current and l:isStandard() and l:isVisible() then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am shiningray on github. | |
* I am shiningray (https://keybase.io/shiningray) on keybase. | |
* I have a public key ASB2sATNtdPsmMsCGDEJqYzhArE4fU8xht1gDMk3dWtJego | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nano = require('nanomsg'); | |
const async = require('async') | |
function createWorker(index) { | |
var worker = nano.socket('rep') | |
const endpoint = 'inproc://worker' + index; | |
worker.bind(endpoint); | |
worker.index = index; | |
worker.on('data', (buf) => { | |
var a = buf.toString(); |
OlderNewer