Skip to content

Instantly share code, notes, and snippets.

View igtm's full-sized avatar
🖥️
Work, work and work!

Iguchi Tomokatsu igtm

🖥️
Work, work and work!
View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@deris
deris / vim_keymapping.md
Created May 2, 2013 10:01
vimで使うキーの機能使用頻度と打ちやすさの整理

vimで使うキーの機能使用頻度と打ちやすさの整理

vimで使うキーの機能使用頻度と打ちやすさを整理してみました。 今回整理したのはnormalモードについてだけです。 機能の使用頻度と打ちやすさは、完全に個人の見解です。 キーボードによっても打ちやすさは変わると思います。

すべてのキーを網羅しているわけではありません。

@denji
denji / nginx-tuning.md
Last active November 20, 2024 03:47
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

  • 🎨 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
@Ajido
Ajido / app.js
Created August 18, 2014 15:20
nodejs express4 cluster graceful restart / shutdown
...
app.use(function(req, res, next){
if (app.get('graceful_shutdown') === true) {
res.set('Connection', 'close');
}
next();
});
app.set('graceful_shutdown_start', function() {
@ohsawa0515
ohsawa0515 / elasticsearch-older-index-delete.sh
Last active June 2, 2021 02:47
Elasticsearchのlogstash形式の古いインデックスを削除するスクリプト
#!/bin/sh
# インデックスのプレフィックス
PREFIX="logstash-"
if [ $1 ]; then
PREFIX=$1
fi
# OLDER_THAN日以上経過したインデックスを削除する
OLDER_THAN=30
@danackerson
danackerson / 100_base.conf
Last active September 19, 2024 15:42
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {
@robinrendle
robinrendle / browsersync-webpack.md
Last active September 17, 2024 16:58
Getting set up with Browsersync and Webpack

Fixing our local environment with Browsersync

Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server and BrowserSync we can fix this:

npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server

BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.

@swillits
swillits / Keycodes.swift
Last active October 22, 2024 15:30
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35
Go 13 hrs 56 mins █████████████▌░░░░░░░ 64.6%
Terraform 3 hrs 5 mins ███░░░░░░░░░░░░░░░░░░ 14.3%
SQL 1 hr 32 mins █▍░░░░░░░░░░░░░░░░░░░ 7.1%
TypeScript 1 hr 15 mins █▏░░░░░░░░░░░░░░░░░░░ 5.8%
YAML 1 hr 11 mins █▏░░░░░░░░░░░░░░░░░░░ 5.5%