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/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@didxga
didxga / index.html
Created October 13, 2018 08:17
JS Bin [feature friendly pad nav lib] // source https://jsbin.com/hixokad
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[feature friendly pad nav lib]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.card {
height: 200px;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.card {
height: 200px;
width:95%;
@didxga
didxga / Backbone singleton implementation 1
Last active November 23, 2016 10:49
Different Backbone Singleton Implementations
//code quote from http://blog.robertpataki.com/blog/2015/08/04/using-the-singleton-pattern-in-requirejs/
define([],
function() {
'use strict';
var instance = null;
function Singie() {
@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 / calendar.html
Created August 4, 2012 10:44
Simple Calendar Widget
<html>
<head>
<style type="text/css">
#calendar_container {
width:230px;
height:220px;
border: solid 1px green;
position:relative;
}
#data_chooser {
@didxga
didxga / a.html
Created June 14, 2012 19:34
demonstrate $.getScript useage
<html>
<head>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
//do not forget put your code inside onload handler function!!!
$("a#1").click(function(){
$("#center_content").load("b.html", function(){
$.getScript("c.js")
});