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
// ==UserScript== | |
// @name stop keybindings | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.notion.so/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=notion.so | |
// @grant none | |
// ==/UserScript== |
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 Hash | |
def to_struct | |
klass = Struct.new(*keys.map(&:to_sym).uniq, keyword_init: true) | |
klass.new(self) | |
end | |
end | |
pp({ :keys => 'arienai', 'keys' => 'unko'}.to_struct) | |
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
#! /bin/sh | |
echo 'Run ripper-tags on background...' | |
(ripper-tags -R > /dev/null) & |
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
// ==UserScript== | |
// @name Disable ctrl+h to return page | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Disable ctrl+h to return page | |
// @author oieioi | |
// @match https://one.newrelic.com/launcher/* | |
// @grant none | |
// ==/UserScript== |
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
require 'benchmark' | |
time = 100_000_0 | |
ary = [1,1,1,1,1,1,1,1,1,1,2,2,2,1,2,2,2,1,2,2,2,2,1,2,1] | |
puts "Array#uniq:#{Benchmark.realtime { time.times { ary.uniq } }}" | |
puts "Array#| :#{Benchmark.realtime { time.times { ary | [] } }}" | |
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
const http = require('http') | |
const SLEEP_MSEC = 1000; | |
let count = 1; | |
console.log('hello, world') | |
const server = http.createServer((req, res) => { | |
count++ | |
const number = count | |
console.log(`req: ${number} |
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
require 'active_support/all' | |
def main | |
rb_file_paths_raw = `find app -type f -name '*.rb'` | |
rb_file_paths = rb_file_paths_raw.split("\n") | |
rb_file_paths.each do |file_name| | |
spec_file_name = file_name.sub(/^app/, 'spec').sub(/.rb$/, '_spec.rb') |
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
git grep -h -o -E "ENV(\[|\.fetch).*"| | |
ruby -ane 'puts $_.match(%r|['\''"](.+?)["'\'']|)[1]' | | |
sort | | |
uniq |
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
#! /bin/sh | |
echo 'Run ctags in background...' | |
(/usr/local/bin/ctags -R . > /dev/null 2>&1) & |
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 Klass | |
CONST_1 = 1 | |
class << self | |
CONST_2 = 2 | |
def klass_method | |
# ok | |
puts CONST_1 | |
# ok |
NewerOlder