Skip to content

Instantly share code, notes, and snippets.

@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
(def fib (lazy-cat '(0N 1N) (map + (rest fib) fib)))
;(nth fib 1000)
;43466557686937456435688527675040625802564660517371780
;40248172908953655541794905189040387984007925516929592
;25930803226347752096896232398733224711616429964409065
;33187938298969649928516003704476137795166849228875N
@MoyTW
MoyTW / xhrio_examples.cljs
Last active July 16, 2016 15:14
Some basic examples of how to use XhrIo. Server is at: https://github.com/MoyTW/BlogSnippets/tree/master/XhrIoExamples
(ns xhrio-examples.examples
(:require [goog.net.XhrIo :as xhrio]
[goog.structs :as structs]
[goog.Uri.QueryData :as query]))
(def get-text-url "http://localhost:3000/get-text")
(def get-json-url "http://localhost:3000/get-json")
(def post-url "http://localhost:3000")
(def post-form-url "http://localhost:3000/post-form")
(def post-json-url "http://localhost:3000/post-json")
@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@ChiaraHsieh
ChiaraHsieh / Sublime Text 2 Markdown Theme Editing.md
Last active December 22, 2015 21:39
Sublime Text 2 markdown syntax highlighting. Add tinkering code segment to your current .tmTheme. Edit the font colors in .tmTheme according to the sector names indicated in the "Markdown Theme Editing.md" gist. (Default color scheme: Green, designed for Phoenix Dark Green - Eighties.tmTheme)

Markup: Heading

Header


The line above is Markdown separator

  • This
  • Is
@babyking
babyking / autohotkey.ahk
Last active December 18, 2019 03:01
自己使用的Autohotkey 脚本 绝大多数的习惯与我的MAC上定义快捷键是一致的. mac上实现此脚本中快捷键主要是通过 keyremap4macbook来实现的.大部分定义受vi以及unix的一些快捷键影响,另外,刚刚买了一个hhkb键盘,部分定义也受其启发.
/*
* email: babyking1949@gmail.com
* update: 2013/3/9
*/
;常用快捷命令
:://cmd:: ;打开命令行
Run cmd
return
@aaronwolen
aaronwolen / slides.md
Last active November 11, 2022 23:57
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide

List

@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

@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"
@kespindler
kespindler / gist:1933962
Created February 28, 2012 17:52
Python Null object, behaves like nil in Objective-C
## {{{ http://code.activestate.com/recipes/68205/ (r1)
#!/user/bin/env python
"""null.py
This is a sample implementation of the 'Null Object' design pattern.
Roughly, the goal with Null objects is to provide an 'intelligent'
replacement for the often used primitive data type None in Python or
Null (or Null pointers) in other languages. These are used for many