Skip to content

Instantly share code, notes, and snippets.

Avatar

Wilson Bilkovich wilson

View GitHub Profile
@wilson
wilson / .vimperatorrc
Created Nov 15, 2010
Download the current youtube page in the background
View .vimperatorrc
" This gets added to your vimperatorrc; makes ':yt' trigger youtube-dl
" You can also bind it directly to a keystroke.
" Requires youtube-dl: https://github.com/rg3/youtube-dl
" On a Mac with Homebrew installed, you can 'brew install youtube-dl'
comm! yt 'exe "!" + eval("plugins.youtubeDownload.youtubeDownload()")'
View happybirthdayadatask.adb
--
-- Is there a better way to celebrate ones birthday than
-- generating an Ascii cake and some text-output wishin
-- happy birthday to the person I consider one of the most
-- important person in the history of automated computation.
--
-- Note:
-- Compile with gcc after having installed GNAT (If on OSX)
-- $> gcc -c happybirthdayadatask.adb
-- $> gnatbl -o happybirthday happybirthdayadatask.ali
View Base C++ makefile
CPPFLAGS += -D_BSD_SOURCE -D_XOPEN_SOURCE=600 \
-I/usr/local/include -Isrc
CXXFLAGS += -std=c++98 -fno-rtti -fno-exceptions -pipe \
-Wall -Wextra -Werror -Wcast-align -Wstrict-overflow -Wshadow
LDFLAGS += -L/usr/local/lib
INSTALL ?= install
ifdef pkg_config_libs
CPPFLAGS += $(shell pkg-config --cflags $(pkg_config_libs))
@jboner
jboner / latency.txt
Last active May 19, 2022
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
----------------------------------
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
@quchen
quchen / trolling_haskell
Last active May 7, 2022
Trolling #haskell
View trolling_haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@cincodenada
cincodenada / logsb
Created Nov 2, 2013
A quick alias in irssi to save the scrollback log to a file. I recently turned on logging (/set autolog ON), and wanted to save what scrollback I'd kept as well. After some reading up, this should add the /logsb command, which stores logs for the current channel in the same place as the default logging, in files tagged .scrollback.log. The alias…
View logsb
/alias logsb lastlog -file ~/irclogs/${tag}/${C}.${F}_${Z}.scrollback.log
@cryptix
cryptix / vineScrape.go
Created Aug 27, 2014
extract a javascript object value from a html page using goquery and otto
View vineScrape.go
package main
import (
"errors"
"log"
"os"
"github.com/PuerkitoBio/goquery"
"github.com/robertkrimen/otto"
)
View learning_haskell.md

Tools

  • Cabal
    • Starting a new project
    • Sandboxes
      • Creating
      • Deleting
    • Adding dependencies
    • Installing dependencies
    • Adding one or more test suites
View handler.js
var child_process = require('child_process');
exports.handler = function(event, context) {
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' });
proc.on('close', function(code){
if(code !== 0) {
return context.done(new Error("Process exited with non-zero status code"));
}
@rygorous
rygorous / gist:e0f055bfb74e3d5f0af20690759de5a7
Created May 8, 2016
A bit of background on compilers exploiting signed overflow
View gist:e0f055bfb74e3d5f0af20690759de5a7
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.