Skip to content

Instantly share code, notes, and snippets.

View k2052's full-sized avatar
🦄
awesome

K k2052

🦄
awesome
View GitHub Profile
@k2052
k2052 / customDomainsBrainstorm.rb
Created April 12, 2012 02:29
An insight into how my mind works.
Customdomains.controllers :items do
# alright lets say we do this
get :show, :maps => ['/portfolios/:slug/items/:slug', '/items/:slug'] do
end
# No need to worry about portfolioes/:id because that wont be accessed via domain.
# The only problem then is determining url_for
# We could simply default to the first path [0] and in url_for do url_for(:items, :show, :map => 1)
# The only thing to solve then is nested routes
@k2052
k2052 / padrinoTagSnippets.slim
Created April 19, 2012 20:53
Padrino snippets
==f.select :category_id, :collection => Category.all, :fields => [:title, :id]
@k2052
k2052 / luaqtExample.lua
Created May 21, 2012 23:33
Lua QT Bindings Example
require 'qtcore'
require 'qtgui'
app = QApplication.new(1, {'lua'}, 1)
btn = QPushButton.new("Hello World!")
btn:connect('2pressed()', function(self)
print("I'm about to close...")
self:close()
end)

This is so amazing. I've printed it out and built a shrine to it. I've taken to calling it "The Icon". Thou shall have no other icons before "The Icon".

At first I couldn't stop worshipping it & my work performance was suffering. I thought about quitting my job & founding a religion devoted to the icon, but then I thought of my wife & kids how would I support them?

Religion doesn't pay well and there was no way I was going to ask my shitty father in law to help out. That guy is a douchebag & he thinks all I do is sit around all day drawing things. He doesn't understand the value of art in the world.

So in the interest of keeping my family clothed, fed & housed I set about creating a relatively reasonable worship schedule. I've had to take a serious paycut to allow myself the extra free time needed for my worship duties.

We've had to sell a car & the kids now sleep on the floor. But I trust that The Icon will bestow blessings upon us soon; if I just worship a little harder.

@k2052
k2052 / Makefile.am
Created July 12, 2012 19:22
Working babl Makefile for OSX
## Source directory
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
SUBDIRS = base
c_sources = \
babl.c \
@k2052
k2052 / tweetsIamOSX.md
Created August 6, 2012 18:53
Tweets for starting an OSX parody account.

I'm on a fucking Mountain. No Lions though. WTF Apple, it's too cold up here for cats.

Nicknaming my latest release Kitty is just a way for you to release joke.

Can you feel the Twitter inside you? I can feel the Twitter inside me.

@k2052
k2052 / miscWIPTweets.md
Created August 6, 2012 19:01
Misc Tweets For Parody Accounts. Guess what accounts they go to.

It seems awfully dangerous to have a fight on top of a train but I won't let that stop me.

She is funny and has boobs, I shall fav her tweets until she notices me.

In javascript (mind == blown) !== (mind === blown)

I've not got any work done today but I've made dick jokes on twitter.

A horse walks into a bar & the bartender asks "Why the long face?". The patrons do not find the bartender amusing & they call Animal Control
What is brown and walks on two legs? A dog with two legs.

@k2052
k2052 / cssGradientSyntax.css
Created August 6, 2012 19:16
CSS Gradient Syntax
background-image: -moz-linear-gradient(-90deg, rgba(0,0,0,1) 0%,
@include background-image(linear-gradient(left top, rgba(30,87,153,1) 0%,rgba(41,137,216,0.67) 50%,rgba(37,131,210,0.59) 63%,rgba(32,124,202,0.78) 80%,rgba(125,185,232,1) 100%));
@k2052
k2052 / haml2slimdir.sh
Created August 6, 2012 19:23
Haml 2 Slim Dir
#!/bin/bash
if [ -z "$1" ]; then
wdir="."
else
wdir=$1
fi
for f in $( find . -name '*.erb' ); do
out="${f%.erb}.haml"
if [ -e $out ]; then
@k2052
k2052 / testParentChildMongoMapper.rb
Created August 6, 2012 19:25
Test Parent Child MongoMapper
require 'mongo_mapper'
MongoMapper.connection = Mongo::Connection.new('localhost')
MongoMapper.database = 'playground'
class Parent
include MongoMapper::Document
key :name, String
many :children
end