Skip to content

Instantly share code, notes, and snippets.

View heycarsten's full-sized avatar

Carsten Nielsen heycarsten

View GitHub Profile
@heycarsten
heycarsten / gist:1163
Created July 22, 2008 17:40
Access list for #rubyfringe, if you want access let me know and I'll be glad to add you.
access #rubyfringe list
1 heycarsten +votsriRfAF [modified ? ago]
2 wmoxam +oOtsi [modified 4 hours, 44 minutes, 28 seconds ago]
3 Nex3 +oOtsi [modified 4 hours, 44 minutes, 36 seconds ago]
4 anteaya +oOtsi [modified 4 hours, 44 minutes, 14 seconds ago]
5 hiffy +oOtsi [modified 4 hours, 43 minutes, 46 seconds ago]
6 iambpentameter +oOtsi [modified 4 hours, 42 minutes, 55 seconds ago]
7 AccordionGuy +oOtsi [modified 4 hours, 42 minutes, 28 seconds ago]
8 elight +oOtsi [modified 4 hours, 42 minutes, 18 seconds ago]
require 'coffee'
require 'water'
require 'cup'
require 'carsten'
cup = Cup.new(:size => 'small')
cup.add(Coffee::Espresso.new(:shots => 3))
cup.add(Water::Ice.new(:cubes => 12))
cup.join
@heycarsten
heycarsten / example.html
Last active August 29, 2015 14:11
Aliasing Ember properties depending on existence of other properties
<html>
<head>
<title>Learnin'</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css" rel="stylesheet">
<style>
body {
margin: 30px auto;
width: 600px;
}
#!/usr/bin/env ruby -w
require File.join(ENV['TM_SUPPORT_PATH'], '/lib/textmate')
PROJECT_DIR = ENV['TM_PROJECT_DIRECTORY']
METHOD_NAME = ENV['TM_CURRENT_WORD'] || ENV['TM_CURRENT_SELECTION']
def blank?(string)
string.nil? || string.strip.eql?('')
end
SELECT * FROM `workspace_layout_blocks` WHERE (`workspace_layout_blocks`.owner_id = 1 AND `workspace_layout_blocks`.owner_type = 'WorkspaceLayout') AND (`workspace_layout_blocks`.`type` IN ('FeatureBlock','FeatureListBlock'))
LearnHub.ColorPalette = {
init : function()
{
$$('.color-palette-swatch-color').
invoke('observe', 'click', LearnHub.ColorPalette.selectSwatchViaEvent);
},
selectSwatch : function(element)
{
#!/bin/sh
#
# Copyright (c) 2007 Andy Parkins
#
# An example hook script to mail out commit update information. This hook sends emails
# listing new revisions to the repository introduced by the change being reported. The
# rule is that (for branch updates) each commit will appear on one email and one email
# only.
#
# This hook is stored in the contrib/hooks directory. Your distribution will have put
using terms from application "Quicksilver"
on process text tweet
tell application "Keychain Scripting"
set twitter_key to first Internet key of current keychain whose server is "twitter.com"
set twitter_login to quoted form of (account of twitter_key & ":" & password of twitter_key)
end tell
set twitter_status to quoted form of ("source=qucs&status=" & tweet)
set results to do shell script "curl --user " & twitter_login & " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json"
-- display dialog results
return nothing
Rehearsal ----------------------------------------------------------------
Case Equality Operator 3.590000 0.970000 4.560000 ( 4.560098)
Object#is_a? Method 3.520000 0.970000 4.490000 ( 4.485853)
Object#class == class 4.230000 0.970000 5.200000 ( 5.212452)
Case Statement (class.to_s) 3.390000 0.970000 4.360000 ( 4.366338)
Case Statement (Proper Form) 2.340000 0.960000 3.300000 ( 3.293166)
------------------------------------------------------ total: 21.910000sec
user system total real
Case Equality Operator 3.570000 0.960000 4.530000 ( 4.541271)
require 'open-uri'
labe = open("http://en.wikipedia.org/wiki/Labe").read
usa = open("http://en.wikipedia.org/wiki/USA").read
puts labe
puts "\n\n\n"
puts usa