Skip to content

Instantly share code, notes, and snippets.

View h3rald's full-sized avatar

Fabio Cevasco h3rald

View GitHub Profile
@h3rald
h3rald / filecopy.pn
Created July 8, 2012 18:17
How to copy (or better, clone) files in Potion
Path = class (path): /path = path.
Path read = ():
file = File (/path, "r+")
r = file read (100)
contents = (r)
while (r != nil):
r = file read (100)
contents append (r)
.
@h3rald
h3rald / litestore.go
Created October 23, 2011 16:58
LiteStore.go
package main
import (
"fmt"
"flag"
"crypto/sha1"
"time"
"strconv"
"io/ioutil"
sqlite3 "github.com/kuroneko/gosqlite3"
@h3rald
h3rald / checklist.rb
Created September 11, 2011 19:18
A simple DSL to create checklists and questionnaires.
class Symbol
def / sym
:"#{self}/#{sym}"
end
def ~
Checklist.lists[self].start
end
end
@h3rald
h3rald / dirscan.rb
Created September 11, 2011 19:06
Directory Scanner based on SHA1 hash comparison
require "pathname"
require "digest/sha1"
require "yaml"
require 'trollop'
module DirScan
class Scanner
def initialize dir=Dir.pwd, options={:verbose => false}
@h3rald
h3rald / pasty.rb
Created August 22, 2011 15:29
Pasty - The Tasty Clipboard Manager
require "yaml"
class Clip < Shoes::Widget
attr_reader :content
def initialize(content=nil)
@content = content || app.clipboard.strip
stack :margin => 5 do
" Vim syntax file
" Language: Glyph
" Last Change: 2010-04-21
" Author: Fabio Cevasco <h3rald@h3rald.com>
if exists("b:current_syntax")
finish
endif
"setlocal autoindent
@h3rald
h3rald / litestore.rb
Created March 28, 2010 20:12
SQLite-powered Key/Value Store
require 'yaml'
require 'digest/sha2'
require 'rubygems'
require 'sequel'
class LiteStore
attr_reader :artifacts
attr_reader :db
@h3rald
h3rald / improved_irb.rb
Created April 26, 2009 10:00
IRB Improvements
#!usr/bin/env ruby
require 'irb'
require 'irb/completion'
require 'rubygems'
require 'rawline'
require 'pathname'
require 'extlib'
# System extensions