Skip to content

Instantly share code, notes, and snippets.

View didxga's full-sized avatar

Carter Chen didxga

View GitHub Profile
#Here comes my tuning
# https://klaver.it/linux/sysctl.conf
# http://www.kegel.com/c10k.html
# http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-1/
# https://gist.github.com/243632 - vmsappiness
# http://blog.urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/
# https://groups.google.com/forum/#!topic/nodejs/0Z34PH_R88o/discussion
# http://serverfault.com/questions/10852/what-limits-the-maximum-number-of-connections-on-a-linux-server
# http://fasterdata.es.net/fasterdata/host-tuning/linux/
@didxga
didxga / latency.txt
Created June 21, 2016 03:11 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
{
"indent" : {
"value": " ",
"ArrayExpression": 1,
"AssignmentExpression": 1,
"BinaryExpression": 1,
"ConditionalExpression": 1,
"CallExpression": 1,
"CatchClause": 1,
"ConditionalExpression": 1,
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@didxga
didxga / dabblet.css
Created March 29, 2012 08:04 — forked from JoelBesada/dabblet.css
CSS States
/* CSS States */
body {
background: url(http://dabblet.com/img/noise.png);
background-color: #F5F2F0;
font-family: Georgia, serif;
font-size: 18px;
line-height: 1.6em;
text-shadow: 0 2px 0 white;
color: #222;
}
@didxga
didxga / dabblet.css
Created March 6, 2012 05:37 — forked from LeaVerou/dabblet.css
Typing animation with pure CSS
/**
* Typing animation with pure CSS
* Revised. Browser support (as of Feb 2012): Firefox, IE10
*/
@keyframes typing { from { width: 0; } }
@keyframes blink-caret { 50% { border-color: transparent; } }
h1 {
font: bold 200% Consolas, Monaco, monospace;
@didxga
didxga / javascript_will_listen.md
Created November 11, 2011 18:10 — forked from joemccann/javascript_will_listen.md
JavaScript Will Listen - By Bella Morningstar

I wouldn't be so alone

If my Github followers lived in my home

Alex Russell would send a pull request

But I'd be too busy

Return to San Francisco by nine

@didxga
didxga / 0readme.md
Created August 22, 2011 13:23 — forked from paulirish/0readme.md
For converting adium logs to decently sexy HTML

adium log export to HTML

this shit is for exporting this weirdass xml out into some sane HTML.

  • run rename.sh to kill the whitespaces in your xml filenames
    • alternatively fix my htmlify.sh to not break on whitespace'd filenames
  • run htmlify.sh
    • htmlify has a hardcoded destination directory.
    • htmlify also expects the format-html.* files to be up one folder from it.
  • enjoy a bigass directory of all your logs all together with ugly filenames but at least they have nice styles and happy markup.
function t(s,d){
for(var p in d)
s=s.replace(new RegExp('{'+p+'}','g'),typeof d[p][1]=='f'?d[p]():d[p]);
return s;
}
/*
---
license: MIT-style
authors: [Christopher Pitt]
...
*/
(function(){
var template =
'<div class="item">'+