Skip to content

Instantly share code, notes, and snippets.

View e-jigsaw's full-sized avatar

jigsaw e-jigsaw

View GitHub Profile
@e-jigsaw
e-jigsaw / init.lua
Last active November 4, 2022 09:48
hs.loadSpoon("ShiftIt")
spoon.ShiftIt:setWindowCyclingSizes({ 100 }, { 34 })
spoon.ShiftIt:bindHotkeys({
up = {{ 'cmd', 'alt', 'shift' }, 'k' },
down = {{ 'cmd', 'alt', 'shift' }, 'j' },
center = {{ 'cmd', 'alt', 'shift' }, 'c' },
maximum = {{ 'cmd', 'alt', 'shift' }, 'f' }
})
@e-jigsaw
e-jigsaw / co2.ino
Last active December 24, 2021 13:12
#include "M5StickCPlus.h"
#include "SCD30.h"
void setup() {
M5.begin();
M5.Lcd.setTextColor(WHITE);
M5.Lcd.fillScreen(BLACK);
M5.Lcd.setCursor(0,0);
console.log('yo')

Keybase proof

I hereby claim:

  • I am e-jigsaw on github.
  • I am jgs (https://keybase.io/jgs) on keybase.
  • I have a public key ASAoGGW3M3qNl9vSjaqiroxzJIW_vGe5kpl-hE0QGAvhGwo

To claim this, I am signing this object:

<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>APPLE</vendorname>
<vendorid>0x05ac</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>INTERNAL</productname>
<productid>0x0273</productid>
</deviceproductdef>
@e-jigsaw
e-jigsaw / gist:96c25acd5efbefd0ba09
Created February 4, 2015 08:52
Webstorm の設定とかのメモ
  • cmd+shift+A: Command Finder
  • ctrl+Enter: Declare

Command Finder

コマンドをインクリメンタルサーチできる

Declare

localBodyParser = (body)->
str = Object.keys(body)[0] + '=' + body[Object.keys(body)[0]]
str = str.split '\n\r'
res = {}
str.forEach (item)->
item = item.split '='
if item[0].length > 0 then res[item[0]] = item[1]
res
@e-jigsaw
e-jigsaw / contMap.coffee
Last active August 29, 2015 14:13 — forked from lotz84/contEach.js
contMap = (arr, f, g, ans) ->
if ans is undefined then ans = []
if arr.length is 0 and typeof g is 'function' then return g ans else return
f.apply @, [
arr.shift()
(item)-> contMap arr, f, g, ans.concat([item])
ans
]
# Example
doctype html
html
head
meta(charset='utf-8')
body
h1 child!!
script(src='index.js', type='text/javascript')
fs = require 'fs'
fs.readdir 'posts', (err, files)-> files.forEach (file)-> fs.readFile "posts/#{file}", (err, contents)->
contents = contents.toString().split '\n'
title = /# (.*)/.exec(contents[0])[1]
url = /(\d{4})-(\d{2})-(\d{2})-(.*)\.md/.exec file
contents[0] = "# [#{title}](/#{url[1]}/#{url[2]}/#{url[3]}/#{url[4]}.html)"
fs.writeFile "posts/#{file}", contents.join('\n'), (err)-> if err? then console.log err