Skip to content

Instantly share code, notes, and snippets.

View key-amb's full-sized avatar

key-amb key-amb

View GitHub Profile
@mizchi
mizchi / フロントエンドを楽にするために.md
Last active December 14, 2023 11:57
フロントエンドを楽にするために

フロントエンドを楽にするために

Qiitaを支えたい技術 at 時雨祭

About

  • HN: mizchi
  • Qiitaの方からきました(入社半年たったらしい)
  • Reactオジサンはそろそろ飽きてきた
  • Angularに興味が無いのでこっちにきた
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
@yoheia
yoheia / perl_oneliner_example
Last active January 24, 2020 18:12
Perlワンライナー&マルチライナー集
Perl ワンライナーサンプル集
■概要
障害解析のためのログの調査、非互換対応でのソースコードの調査といった
テキスト処理で使った Perl ワンライナーのサンプル集です。
Perl ワンライナーは以下の点が良いと思います。
・Perl は Oracle Database (10g以降) に同梱されている。
 従って、Windows プラットフォームでも使える。
@koemu
koemu / getswap.sh
Created December 18, 2013 01:09
各プロセスのスワップ使用量を調べる。 なお、root or sudo での実行が必要。 参照元: http://northernmost.org/blog/find-out-what-is-using-your-swap/
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
# Updated: 2013-11-13 Yuichiro Saito
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
@kazuho
kazuho / gist:6791809
Last active December 24, 2015 11:38
mysql-ranking-engineの使い方
-- テーブルを作る
CREATE TABLE t (
  user_id int unsigned not null,
  score int not null,
  ranking int unsigned,                -- rankingというカラムがエンジンによって自動更新される
  primary key (user_id),
  key ranking (score)                -- ランキング用のindex                  
) engine=ranking;
@kalmbach
kalmbach / gist:4471560
Created January 7, 2013 01:27
Rake task sugar for Sequel Migrations (version, migrate, rollback, reset)
namespace :db do
require "sequel"
Sequel.extension :migration
DB = Sequel.connect(ENV['DATABASE_URL'])
desc "Prints current schema version"
task :version do
version = if DB.tables.include?(:schema_info)
DB[:schema_info].first[:version]
end || 0
@cosimo
cosimo / parse-options.sh
Created September 21, 2012 09:31
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@wtaysom
wtaysom / where_is.rb
Created September 23, 2011 08:57
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))
# Colorizes the output of the standard library logger, depending on the logger level:
# To adjust the colors, look at Logger::Colors::SCHEMA and Logger::Colors::constants
require 'logger'
class Logger
module Colors
VERSION = '1.0.0'
NOTHING = '0;0'