Skip to content

Instantly share code, notes, and snippets.

View hugochinchilla's full-sized avatar
🤖
I'm not a robot

Hugo Chinchilla Carbonell hugochinchilla

🤖
I'm not a robot
View GitHub Profile
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@fogus
fogus / index.html
Last active December 18, 2015 04:08
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>a sketch</title>
<script type="text/javascript" src="undermine.js"></script>
</head>
<body>
<center>
@ChrisBeaumont
ChrisBeaumont / custom.css
Last active June 22, 2022 15:20
Demystifying Python Descriptors
<style>
@font-face {
font-family: "Computer Modern";
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');
}
div.cell{
width:800px;
margin-left:16% !important;
margin-right:auto;
}
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@andris9
andris9 / README.md
Last active December 29, 2022 02:38
Extremely simple HTTP proxy for changing Host: header Useful when proxying requests to virtual hosts that require Host: header to be set.

Setup reverse tunnel

Run the following in your client machine

ssh -R EXPOSED_PORT:localhost:SERVICE_PORT USER@HOST

Where

  • EXPOSED_PORT is the port exposed to the internet in the proxy server
  • SERVICE_PORT is the port your application is listening in your machine
@jpalumickas
jpalumickas / baruco2014_presentations.md
Last active August 29, 2015 14:06
Baruco 2014 Presentations

Baruco 2014

Friday

Yukihiro Matsumoto (mruby: AltRuby)

Piotr Szotkowski (Standard Library, Uncommon Uses) http://talks.chastell.net/baruco-2014

Pat Shaughnessy (Twenty Thousand Leagues Under ActiveRecord)

@andremedeiros
andremedeiros / talks.md
Last active August 29, 2015 14:06
Baruco 2014 talks

Baruco 2014 talks

Please see the Hackpad where we can all contribute!

window.addEventListener('storage', function(e) {
if (e.storageArea === localStorage) {
var key = e.key;
if (data) {
$(document).trigger('storage.' + e.key, data);
}
}
});
$(document).on("storage.test", function(e, data) {