Skip to content

Instantly share code, notes, and snippets.

View geeknees's full-sized avatar
🙈
Focusing

Masumi Kawasaki geeknees

🙈
Focusing
View GitHub Profile
@geeknees
geeknees / index.js
Created August 14, 2022 05:01
whitelistMarkleTree
const { MerkleTree } = require("merkletreejs");
const keccak256 = require("keccak256");
// List of 7 public Ethereum addresses
let addresses = [
"0x...",
"0x1..",
"0x2..",
"0x3..",
"0x4..",
@geeknees
geeknees / result
Created December 17, 2020 09:55
eachSlice bench
Test start!
chunkWhile x 2,882,663 ops/sec ±0.71% (86 runs sampled)
chunkRec x 2,601,506 ops/sec ±0.91% (86 runs sampled)
chunkReduce x 2,993,484 ops/sec ±0.89% (85 runs sampled)
Fastest is chunkReduce
🌞 Morning 263 commits ██████░░░░░░░░░░░░░░░ 28.7%
🌆 Daytime 351 commits ████████░░░░░░░░░░░░░ 38.3%
🌃 Evening 242 commits █████▌░░░░░░░░░░░░░░░ 26.4%
🌙 Night 61 commits █▍░░░░░░░░░░░░░░░░░░░ 6.7%
@geeknees
geeknees / convert_mkv_to_mp4.sh
Last active August 16, 2017 01:51
convert_mkv_to_mp4.sh
DIRPATH=$1
for FILE in ${DIRPATH}*.mkv; do ffmpeg -i "${FILE}" -vcodec copy -acodec aac -strict experimental -ab 128k -aprofile aac_low -ac 2 -ar 44100 "${FILE%.mkv}.mp4"; done
@geeknees
geeknees / erb_to_haml.sh
Last active August 16, 2017 01:51
erb_to_haml.sh
for filename in *.erb; do html2haml $filename ${filename%.erb}.haml; done
@geeknees
geeknees / 01.sql
Last active August 3, 2017 09:58
cohort SQL
SELECT count(1) as signed_up_users
FROM users
WHERE users.created_at >= now() - interval 2 day
AND users.created_at < now() - interval 1 day;
@geeknees
geeknees / make-flashlight-work-on.yosemite.md
Last active September 14, 2015 07:10 — forked from selaromi/make-flashlight-work-on.yosemite.md
Steps to make Flashlight work on 10.10.4 (doesn't work for El Capitan)

Make Flashlight work on 10.10.4

  1. Install SIMBL http://culater.net/software/SIMBL/SIMBL.php
  2. Copy SpotlightSIMBL.bundle to /Library/Application Support/SIMBL/Plugins/ (a)
  3. Copy Flashlight.osax to ~/Library/ScriptingAdditions/ (b)
  4. Disable Flashlight
  5. Enable Flashlight
  6. Open Script Editor on your Mac (look for "Script Editor In Spotlight") and paste the following code (don't change Snow Leopard for Yosemite)
tell application "Spotlight" to inject SIMBL into Snow Leopard
// ==UserScript==
// @name follow organization
// @description Show follow button on github organization page
// @namespace http://www.technolize.net/
// @include https://github.com/*
// @version 0.1
// @license MIT License
// @work Google Chrome
// ==/UserScript==
// Adblock Plus Whitelist Export. require Developer Tools Console
// @author noromanba
// @license MIT License http://nrm.mit-license.org/2013
// chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/options.html#tab-whitelisted
var area = document.createElement('textarea');
area.id = 'rawDomainText';
//area.readOnly = true;
area.style.width = '500px';
area.style.height = '150px';
@geeknees
geeknees / backup.sh
Created December 18, 2014 11:00
backup
#!/bin/sh
# バックアップファイルを何日分残しておくか
period=7
# バックアップファイルを保存するディレクトリ
dirpath='/home/user/backup_mysql/sql'
# ファイル名を定義(※ファイル名で日付がわかるようにしておきます)
filename=`date +%y%m%d`