Skip to content

Instantly share code, notes, and snippets.

Jay Lim imjching

Block or report user

Report or block imjching

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:639f93369015a7371b20ac40d464a105
{
"Ansi 6 Color" : {
"Green Component" : 0.57082360982894897,
"Red Component" : 0.14679534733295441,
"Blue Component" : 0.52502274513244629
},
"Ansi 12 Color" : {
"Red Component" : 0.42023858428001404,
"Color Space" : "Calibrated",
"Blue Component" : 0.93014276027679443,
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@imjching
imjching / gdb_ruby_backtrace.py
Created Apr 27, 2018 — forked from csfrancis/gdb_ruby_backtrace.py
Dump an MRI call stack from gdb
View gdb_ruby_backtrace.py
# Updated for Ruby 2.3
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
@imjching
imjching / nginx-tuning.md
Created Mar 4, 2018 — forked from denji/nginx-tuning.md
NGINX tuning for best performance
View nginx-tuning.md

Moved to git repository: https://github.com/denji/nginx-tuning

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.

@imjching
imjching / README.md
Created Mar 3, 2018 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@imjching
imjching / output_deployments.txt
Created Aug 21, 2017
Production Engineering / Infrastructure Problem
View output_deployments.txt
Name: db
Namespace: shopify-dev
CreationTimestamp: Sun, 20 Aug 2017 15:41:35 -0700
Labels: app=db
Annotations: deployment.kubernetes.io/revision=1
Selector: app=db
Replicas: 1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 1 max unavailable, 1 max surge
View sample.script
// What to do in the morning
func morning <
name := "Jay";
greet morning=true input=@name;
eat cereals;
attend class="CS101";
>
// What to do at night
func night <
View ScriptLexer.g4
// Name our lexer (the name must match the filename)
lexer grammar ScriptLexer;
// Define string values - either unquoted or quoted
STRING : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'@')+ |
('"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\'))* '"') ;
// Skip all spaces, tabs, newlines
WS : [ \t\r\n]+ -> skip ;
View TestLexer.java
import java.io.File;
import java.io.FileInputStream;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.Token;
public class TestLexer {
public static void main(String[] args) throws Exception {
System.out.println("Parsing: " + args[0]);
You can’t perform that action at this time.