Skip to content

Instantly share code, notes, and snippets.

View volume.sh
#!/usr/bin/env bash
ME=$(basename $0)
MUTEFILE=~/.channels.mute
usage() {
cat <<END
$ME COMMAND [ARGS...]: Volume control / muting
Commands:
View totp.pl
#!/usr/bin/env perl
use v5.16;
use warnings;
use Digest::HMAC_SHA1 qw(hmac_sha1);
use Convert::Base32 qw(decode_base32);
use Getopt::Long;
use Pod::Usage;
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Large Type</title>
<link rel="stylesheet/less" type="text/css" href="style.less">
<script type="text/javascript" src="lib/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="lib/less.min.js"></script>
</head>
<body>
<div class="out"><span contenteditable autofocus>*hello*</span></div>
@tron1point0
tron1point0 / totp.pl
Last active Apr 18, 2016
TOTP Authenticator
View totp.pl
#!/usr/bin/env perl
use v5.16;
use warnings;
use Digest::HMAC_SHA1 qw(hmac_sha1);
use Convert::Base32 qw(decode_base32);
use Getopt::Long;
use Pod::Usage;
View NBT.pm
#!/usr/bin/env perl
package NBT;
use strict;
use warnings;
sub parse {
my ($fh) = @_;
@tron1point0
tron1point0 / keymap.pl
Created Sep 24, 2012
Generates a keyboard map given a list of keybinds
View keymap.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Template::Toolkit::Simple;
use YAML qw(Load);
my %config = Load do {local $/;<DATA>};
@tron1point0
tron1point0 / fizzbuzz.hs
Created Jun 19, 2012
Point-free style, monads, arrows, and a partridge in a pear tree
View fizzbuzz.hs
import Control.Monad
import Control.Arrow
import Data.Monoid
import Data.List(unlines)
import System.Environment(getArgs)
fizzbuzz = uncurry (flip maybe id) . (arr show &&& arr forb)
where tests = map ((.) (==0) . flip mod) [3,5]
fb = map Just ["Fizz","Buzz"]
View rev_case.c
#include <stdlib.h>
#define lc(var) (var >= 'A' && var <= 'Z' ? var + 32 : var)
#define uc(var) (var >= 'a' && var <= 'z' ? var - 32 : var)
#define vowelp(var) ( \
uc(var) == 'A' || \
uc(var) == 'E' || \
uc(var) == 'I' || \
uc(var) == 'O' || \
uc(var) == 'U')
View Makefile
VERSION := 4.1.0
ZIPFILE := ext-$(VERSION)-gpl.zip
download := http://cdn.sencha.io/$(ZIPFILE)
downloader := $(shell which curl)
downloader ?= $(shell which wget)
COFFEE := $(shell which coffee)
UNZIP := $(shell which unzip)
View Magento.pm
package Magento;
use v5.14;
use warnings;
use Carp;
use XML::RPC;
sub new {
my ($class,$uri,$user,$pass) = @_;
my $client = XML::RPC->new("$uri/api/xmlrpc/");