Skip to content

Instantly share code, notes, and snippets.

@pithyless
pithyless / template.html
Created January 1, 2012 13:14 — forked from steveklabnik/template.html
I always end up typing out the minimal (for me) html5 stuff. so here it is.
<!doctype html >
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<nav></nav>
</body>
</html>
@pithyless
pithyless / quality.rake
Created January 1, 2012 13:14 — forked from steveklabnik/quality.rake
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']
@pithyless
pithyless / after.rb
Created January 1, 2012 13:17 — forked from steveklabnik/after.rb
dont load rails!
require 'active_record'
require "#{Rails.root}/app/models/user"
describe User do
it "does something sweet"
it "does something cool"
end
@pithyless
pithyless / mac-homebrew-pyexiv2.sh
Created January 22, 2012 17:19 — forked from jpwatts/mac-homebrew-pyexiv2.sh
In which I finally get pyexiv2 working on my Mac using Homebrew and a series of disgusting hacks
#!/bin/sh
brew install python scons boost exiv2
curl -O http://launchpadlibrarian.net/83595798/pyexiv2-0.3.2.tar.bz2
tar xjvf pyexiv2-0.3.2.tar.bz2
cd pyexiv2-0.3.2
# https://answers.launchpad.net/pyexiv2/+question/140742
echo "env['FRAMEWORKS'] += ['Python']" >> src/SConscript
@pithyless
pithyless / match_method.rb
Created February 8, 2012 08:37 — forked from avdi/match_method.rb
Defining method_missing and respond_to? in one fell swoop
# Do you ever define #method_missing and forget #respond_to? I sure
# do. It would be nice if we could do them both at the same time.
module MatchMethodMacros
def match_method(matcher, &method_body)
mod = Module.new do
define_method(:method_missing) do |method_name, *args|
if matcher === method_name.to_s
instance_exec(method_name, *args, &method_body)
else
@pithyless
pithyless / group_of_thingies.rb
Created February 8, 2012 08:40 — forked from Peeja/group_of_thingies.rb
Test a block in Ruby
class GroupOfThingies
attr_accessor :thingies
# Use like this:
#
# group_of_thingies = GroupOfThingies.new
# group_of_thingies.each do |thing|
# puts "Check out this awesome thing: #{thing}!"
# end
#
@pithyless
pithyless / ken-burns.css
Created February 18, 2012 22:56 — forked from thierryk/ken-burns.css
Ken Burns effect (styling images with panning and zooming effects)
/**
* See: http://www.css-101.org/articles/ken-burns_effect/css-transition.php
*/
/**
* Styling the container (the wrapper)
*
* position is used to make this box a containing block (it becomes a reference for its absolutely positioned children). overflow will hide part of the images moving outside of the box.
*/
@pithyless
pithyless / algorithm.txt
Last active December 29, 2015 00:58 — forked from adamkal/parser.py
0123 0123 0123 0123 0123 0123 0123 0123 0123 0123
1 1 _ 1 _ 1 1 _ 1 _ 1 _ 1 _ 1 _ 1 _
2 | 2 _| 2 _| 2|_| 2|_ 2|_ 2 | 2|_| 2|_| 2| |
3 | 3|_ 3 _| 3 | 3 _| 3|_| 3 | 3|_| 3 _| 3|_|
000101100
+4 +7 -5 +6
0 - 2 4 6789
;;; Use experimental fork of DataScript from https://github.com/allgress/datascript to handle undo and per-query subscriptions
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
@pithyless
pithyless / core.cljs
Last active August 29, 2015 14:20 — forked from luxbock/core.cljs
(ns freactive-datascript.core
(:require [datascript :as d]
[datascript.core :as dc]
[clojure.data :as data]
[freactive.core :as f :refer [IReactive
*invalidate-rx*
*trace-capture*]]))
;;; Playground ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;