Skip to content

Instantly share code, notes, and snippets.

@nrk
nrk / messageManipulation001.io
Created July 25, 2008 06:50
Message manipulation at runtime in Io
foo := block(str,
str asMutable asCapitalized println
)
foo call("my awesome string") // ==> My awesome string
foo message // ==> str asMutable asCapitalized println
foo message next // ==> asMutable asCapitalized println
foo message next next // ==> asCapitalized println
<!--
{
"description": "& test 1",
"expect": {"bozo": false, ["entries", 0, "title_detail", "value"]: "&#38;"]}
}
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<entry>
<title type="text/html" mode="escaped">&</title>
</entry>
@jeffrafter
jeffrafter / sql_views
Created July 25, 2008 08:13
Trying to understand how to use mysql query profiling to win
SELECT count(*)
FROM drug_order
INNER JOIN drug ON drug_order.drug_inventory_id = drug.drug_id
INNER JOIN concept_set as arv_drug_concepts ON
arv_drug_concepts.concept_set = 460 AND
arv_drug_concepts.concept_id = drug.concept_id
WHERE drug.concept_id IS NOT NULL;
=>
+----------+
| count(*) |
@PhilGeek
PhilGeek / installgit.sh
Created July 25, 2008 08:15
Git installation script
#!/bin/sh
#
# installgit.sh
#
# A bash script to install the latest version of Git. Be sure to set the variables to the desired values.
#
# http://git.or.cz/
#
# Mark Eli Kalderon 2008-07-25
// ==UserScript==
// @name Autopagerize for haiku
// @namespace http://rails2u.com/
// @description works on Firefox, Opera, Safari and fub.net
// @include http://h.hatena.ne.jp/*
// @include http://h.hatena.com/*
// ==/UserScript==
(function(unsafeWindow){
var getHeight = (function(){
@Teggy
Teggy / flat_query.sql
Created July 25, 2008 08:24
Flat vs. nested SQL queries (just a gist test)
select max(A)
from R
where R.B in (1,2,3,4,5,6,7,8,9,10)
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'mq'
EM.run do
# open a channel on the AMQP connection
channel = MQ.new
# declare a queue on the channel
queue = MQ::Queue.new(channel, 'queue name')
#import "AppController.h"
#import "Person.h"
@implementation AppController
-(id)init
{
NSLog(@"Initializing");
people = [Person findAll];
return self;
}
   _,,....,,_  _人人人人人人人人人人人人人人人_
-''":::::::::::::`''>  ゆっくりした結果がこれだよ!!! <
ヽ::::::::::::::::::::: ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
 |::::::;ノ´ ̄\:::::::::::\_,. -‐ァ     __   _____   ______
 |::::ノ   ヽ、ヽr-r'"´  (.__    ,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、
_,.!イ_  _,.ヘーァ'二ハ二ヽ、へ,_7   'r ´          ヽ、ン、
::::::rー''7コ-‐'"´    ;  ', `ヽ/`7 ,'==─-      -─==', i
r-'ァ'"´/  /! ハ  ハ  !  iヾ_ノ i イ iゝ、イ人レ/_ルヽイ i |
!イ´ ,' | /__,.!/ V 、!__ハ  ,' ,ゝ レリイi (ヒ_]     ヒ_ン ).| .|、i .||
`!  !/レi' (ヒ_]     ヒ_ン レ'i ノ   !Y!""  ,___,   "" 「 !ノ i |
@cooldaemon
cooldaemon / edoc_test.erl
Created July 25, 2008 09:23
I'm practicing writing the EDoc.
%% @author Masahito Ikuta <cooldaemon@gmail.com> [http://d.hatena.ne.jp/cooldaemon/]
%% @copyright Masahito Ikuta 2008
%%
%% @doc The sample module for the EDoc.
%%
%% I'm practicing writing the EDoc.
%% This file was made because of the practice.
%%
%% Here's a quick example illustrating how to use edoc_test:
%% ```