Skip to content

Instantly share code, notes, and snippets.

View serialhex's full-sized avatar
😸
Pondering language design...

serialhex

😸
Pondering language design...
View GitHub Profile
@Narnach
Narnach / cotd.rb
Created January 12, 2009 15:07
Show the manpage of a random executable in your $PATH
#!/usr/bin/env ruby
# Command of the day
# Picks a random executable from your path until it finds one with a manpage.
# Use this to learn about some of the really obscure yet really useful scripts that are already on your system.
files = ENV["PATH"].split(":").uniq.compact.map { |path|
Dir.glob(File.join(path,'*')).select {|file| File.file?(file) && File.executable?(file)}
}.flatten.compact.uniq
cotd = File.basename(files[rand(files.size)])
CONDOM(1) EUNUCH Programmer's Manual CONDOM(1)
NAME
condom - Protection against viruses and prevention of child
processes
SYNOPSIS
condom [options] [processid]
@ankurs
ankurs / fsm.c
Created April 4, 2010 21:15
FSM in C
/**
* @file fsm.c
* @brief an implementation for a FSM in C, this file contains
* implementation of definations.
* License GPLv3+
* @author Ankur Shrivastava
*/
#include "fsm.h"
#include<stdlib.h>
=begin
Author: Jabari Zakiya, Original: 2009-12-25
Revision-2: 2009-12-31
Revision-3: 2010-6-2
Revision-4: 2010-12-15
Revision-5: 2011-5-11
Revision-6: 2011-5-15
Module 'Roots' provides two methods 'root' and 'roots'
which will find all the nth roots of real and complex
@razor-x
razor-x / scss.xml
Created May 6, 2011 08:16
SCSS syntax highlighting for Kate. Based on Kate CSS syntax file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
Kate SCSS syntax highlighting definition
Modified the Kate CSS syntax highlighting definition to support SCSS.
This file should be merged with any updates to the normal Kate CCS definition (see note on version numbering in changelog for 1.2.03.0).
The latest version of this file can be found at https://gist.github.com/958598
@vmg
vmg / gist:959251
Created May 6, 2011 16:07
2000 curated "that's what she said" jokes to train a Bayesian classifier
Wow! It's so much better when you do it faster!
Take it out and start working on it.
I wish you would finish already.
This thing is huge. I can hardly put my hand around it and it wont fit in my mouth.
When you push it down, it's supposed to rise back up.
I hate it when balls come near me.
Alright Justin, what am I doing wrong here, help me out cause it shouldn't take this long.
Wow, why do you only have one hand on there? Is it not big enough for both of them?
I think I cant swallow it anymore.
I like the long thick black ones.
@r-moeritz
r-moeritz / pretty-literals.lisp
Created June 24, 2011 10:30
pretty hash table & vector literal syntax for common lisp
;;;; pretty-literals.lisp - pretty hash table & vector literal syntax
;;;; inspired by and uses code from http://frank.kank.net/essays/hash.html
(in-package #:pretty-literals)
;; vector literal syntax using brackets
(set-macro-character #\[
(lambda (str char)
(declare (ignore char))
(let ((*readtable* (copy-readtable *readtable* nil))
@steveklabnik
steveklabnik / quality.rake
Created July 11, 2011 20:18
My new favorite Rake task
require 'flog'
require 'flog_task'
require 'flay'
require 'flay_task'
require 'roodi'
require 'roodi_task'
FlogTask.new :flog, SOME_NUMBER_HERE, %w[app lib]
FlayTask.new :flay, OTHER_NUMBER_HERE, %w[app lib]
RoodiTask.new 'roodi', ['app/**/*.rb', 'lib/**/*.rb']
@rawbitrec
rawbitrec / HelloWorld.cpp
Last active September 27, 2015 06:48
Ye Olde Sea Pluss Pluss!
//created by Eliot Lash and Robert Muller on 10/3/10
//copyright Eliot Lash and Robert Muller 2011
//Welcome to Ye Olde Sea Pluss Pluss!
#include <iostream>
#include <string>
#include "olde.h"
#define normal
@wridgers
wridgers / .tmux.conf
Created February 7, 2012 16:05
tmux config file
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g history-limit 1000