Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Carp;
use IO::File;
use JSON;
use WWW::Mechanize;
ObjectSpace::AllocationTracer.trace do
5.times do
foo = "foo".freeze
end
end
#=> {}
@TikhonJelvis
TikhonJelvis / viz.hs
Last active September 22, 2016 06:05
Generating graphs for my Quora answer
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
import qualified Data.Graph.Inductive as Graph
import Data.Graph.Inductive (Gr, match, matchAny)
import Data.String.Interpolation (str)
complex :: Gr () ()
complex = Graph.mkGraph nodes edges
where nodes = [(x, ()) | x <- [1..10]]
@yorkxin
yorkxin / KKBOX KBL.md
Last active August 29, 2015 13:59
KKBOX 歌單 (KBL 檔)
@namuol
namuol / INSTALL.md
Last active December 11, 2024 12:21
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@orend
orend / gist:9099893
Last active August 29, 2015 13:56
Time travel and dependencies
def age(with_respect_to = Time.now)
...
end
@caasi
caasi / maple_future_0.txt
Created February 17, 2014 08:59
十五年前,前輩先進們討論著 BBS 的未來。
作者 Thor (淡出) 看板 plan
標題 Maple未來發展
時間 Fri Jul 24 09:47:41 1998
───────────────────────────────────────
只是隨便取個聳動的標題而已:ppp
現在 bbtpd.c opus還沒寫完就消失了,
我在想直接接下去寫會不會對他大不敬呀?:P
function copyToClipboard( text ){
var copyDiv = document.createElement('div');
copyDiv.contentEditable = true;
document.body.appendChild(copyDiv);
copyDiv.innerHTML = text;
copyDiv.unselectable = "off";
copyDiv.focus();
document.execCommand('SelectAll');
document.execCommand("Copy", false, null);
document.body.removeChild(copyDiv);
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@gruber
gruber / make_bookmarklet.pl
Last active May 5, 2024 21:11
JavaScript Bookmarklet Builder
#!/usr/bin/env perl
#
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder
use strict;
use warnings;
use URI::Escape qw(uri_escape_utf8);
use open IO => ":utf8", # UTF8 by default
":std"; # Apply to STDIN/STDOUT/STDERR