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 June 28, 2025 15:27
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 June 25, 2025 21:52
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%