Skip to content

Instantly share code, notes, and snippets.

@Jxck
Jxck / README.md
Created December 16, 2012 09:16
libuv TCP server/client sample

how to compile

$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices server.c -o server
$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices client.c -o client
@mattetti
mattetti / gist:3798173
Last active April 16, 2023 03:09
async fetching of urls using goroutines and channels
package main
import (
"fmt"
"net/http"
"time"
)
var urls = []string{
"https://splice.com/",
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tbranyen
tbranyen / backbone.collectioncache.js
Created June 4, 2012 06:37
Backbone.Collection caching by URL
/*!
* backbone.collectioncache.js v0.0.2
* Copyright 2012, Tim Branyen (@tbranyen)
* backbone.collectioncache.js may be freely distributed under the MIT license.
*/
(function(window) {
"use strict";
// Dependencies
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@remino
remino / datediff.js
Created January 5, 2012 06:07
JavaScript: DateDiff & DateMeasure: Calculate days, hours, minutes, seconds between two Dates
(function() {
function DateDiff(date1, date2) {
this.days = null;
this.hours = null;
this.minutes = null;
this.seconds = null;
this.date1 = date1;
this.date2 = date2;
@codenothing
codenothing / performance.js
Created March 16, 2011 04:38
Semi-Detailed page load performance timings
// http://w3c-test.org/webperf/specs/NavigationTiming/
(function( window ) {
// Skip unsupported browsers
if ( ! window.performance || ! window.performance.timing ) {
return;
}
// Output
function perf(){