Skip to content

Instantly share code, notes, and snippets.

@kumatch
kumatch / doc.md
Last active June 28, 2023 12:20
コントリビュートマインド

仮定

コントリビュートマインドが高水準の活動とポジティブマインドを生み出し、かつ自身の成長を大きく促す。

コントリビュートマインドの定義(仮)

自身の活動空間における観測可能な範囲において
解決したい様々な課題、あるいは突発的に発生する物事に対し
立場や役割、計画の有無に関わらず
それら解決のため寄与、貢献する活動を経て

// https://www.typescriptlang.org/ja/play?#code/MYewdgzgLgBAllApgWwjAvDA2gKBjAb3gBMAuGARgoBoYwBDZRcgcgDMQQWBfavQkuQoAmWgyasARvQBOPHAF0cOYABt6ENAAVZiMLAL8ZiesXCqAniQD85MAFdkkxDIDcy-KEhQZ94FBAZAApZAHMIch0ZKDh6VQAeKL0oAD4ASkJ+fAB5SQArRH8AOg0IOFCwIKgACzgIWjCINPd8bnwPGGh6GOAYNjgwYniAFRhEAA8kQbQoCwAHRBA2GCT9GAAyATjVcgBJb3owYERh+cQRlKwFGG4UqtqImGHaODI6R2cZNL2Do5Ozi4wAA+MHsg0Q-TAiGImXw+GMUHsMjAMBqdRKqlURUhxCCKPQKToRVeGEwrzS-G4HS6PRgAHdqi5zqMJlNiDMzksVro1psiNsfl0-qcFhcrjc7mjHs8YHNZIxHgQsABrRAWcjQGQDUIKciHCzcb4wfZC44i5mXa6GOEwLzQGCqixoTC5ArFR0QIJymQKilZGAIpEoqUYrH9VRIYL4wnWm0BxCI5EOtUQIqIABuLgsQUdGBj-ptgaTYBVapgGmTFi5qyg13Q9dl8tQpYsSjjN2a-sNLRuHVCCfgEC0LjK0GhQSNkk4qhMKNj8ITQdRD2JMIAhA2wcQIQNoT2qVSVOpNMakMgxpM9OzucY1rHjKZzFZXmu7B8XD2H2YwJY6IxEK+nQ+Nq7j8HaPh+AEwSNJEsgxHE8S7Ge6SwnCED2As0EyOEnY2q6hRQCUmjlJUUoNNhTT7tSUDdHAvT9rA2wTqhhaLkmCAoKmyD0HMQQceeBJ0IgdKnigfFnmkuG9oe4HlhgonINiAy4lQnZ2iAM5FKoIChCEangBAGmIFpOkhNYxJDiOdRIMQ+mQEZJm6UhKBFAyTJBEQrxCKIf4SDALDSHIhqdsoOBAA
const items = [
{ id: 11, name: 'foo'},
{ id: 12,
@kumatch
kumatch / format_routes.rb
Last active August 1, 2019 05:10
list rails controller_path, action from routes.
#!/usr/bin/env ruby
ARGF.each do |line|
case line.chomp
when /^\s+Prefix/, "" then
# header
when /^Routes for /
# fin routes.
break
when /^\s*(?:(\w+) )?(GET|POST|PUT|PATCH|DELETE)\s+(\S+)\s+([\w\/]+)#(\w+)/ then
@kumatch
kumatch / bench.txt
Created August 6, 2018 08:23
go map access
# go test -bench . -benchmem
goos: darwin
goarch: amd64
BenchmarkMap1-4 100000 24314 ns/op 2800 B/op 280 allocs/op
BenchmarkMap2-4 50000 25083 ns/op 2800 B/op 280 allocs/op
@kumatch
kumatch / rails_resources.md
Created May 23, 2014 04:03 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@kumatch
kumatch / 0_reuse_code.js
Created May 23, 2014 04:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kumatch
kumatch / app.js
Last active August 29, 2015 14:01
Browserify + AngularJS module example
var angular = require('angular');
module.exports = angular.module('myapp', [
require('./item').name,
require('./sample').name
]);
@kumatch
kumatch / Gruntfile.js
Last active March 1, 2018 17:44
A browserify simple example.
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
browserify: {
dist: {
src: 'main.js',
dest: 'build.js'
}
}
@kumatch
kumatch / daemon.js
Created March 25, 2013 01:49
Node.js daemon example
var fs = require('fs');
var INTERVAL = 1000;
var cycle_stop = false;
var daemon = false;
var timer;
process.argv.forEach(function (arg) {
if (arg === '-d') daemon = true;
@kumatch
kumatch / gist:2392366
Created April 15, 2012 12:10
async.js forEach block
var doTask = function (value, callback) {
setTimeout(callback(value), 10);
};
var list_count = 100000;
var check_count = list_count / 10;
var list = [];
for (var i = 0; i < list_count; i++) list.push(i);