Skip to content

Instantly share code, notes, and snippets.

View lalala's full-sized avatar

Per Andersen lalala

  • Stockholm, Sweden
View GitHub Profile
.lists
- if @lists
%ul
- @lists.each do |list|
%li
= list.title
%ul
- list.list_items.each do |li|
%li
= li.content
<?php
$redis = new Redis;
$redis->connect('localhost', 6397);
try {
$redis->set('foo', 'bar');
} catch ( Exception $e ) {
die($e->getMessage()."\n");
}
rvm info
ruby-1.9.2-head:
system:
uname: "Linux pollux 3.1.9-2-ARCH #1 SMP PREEMPT Sat Jan 14 09:11:37 CET 2012 x86_64 Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz GenuineIntel GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.2.20(2)-release (x86_64-unknown-linux-gnu)"
zsh: "/bin/zsh => zsh 4.3.15 (x86_64-unknown-linux-gnu)"
rvm:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main() {
char** s = NULL;
char delim[] = " ";
char* tok = NULL;
nextp :: Integer -> Integer -> Integer -> Integer -> [Integer]
nextp r a b m =
r1 : (nextp r1 a b m)
where
r1 = mod (a*r+b) m
metapung :: (Integer -> Integer) -> Integer -> [Integer]
metapung f seed =
n1 : (metapung f n1)
where
.
.
.
char *printenv[] = { "printenv", NULL };
char *sort[] = { "sort", NULL };
char *less[] = { "less", NULL };
unsigned int *pro[3] = { &printenv, &sort, &less };
.
<form id="new_task" class="new_task" method="post" data-remote="true" action="/tasks" accept-charset="UTF-8" style="display: none;">
<div style="margin:0;padding:0;display:inline">
<input id="task_goal_id" type="hidden" value="2" name="task[goal_id]">
<input id="task_description" type="text" size="30" name="task[description]">
<input type="submit" value="Submit" name="commit">
</form>
# doesnt do much
# What I want
$( "#sortable1, #sortable2" ).sortable({
connectWith: ".connectedSortable"
}).disableSelection();
# What I do
$('#current_goals, #future_goals').sortable ({
resources :users do
member do
resources :goals
end
end
=====================================================
this gives
=====================================================
[per@pollux Achievable]$ rake db:migrate
/home/per/.rvm/gems/ruby-1.9.2-head@achievable/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
rake aborted!
Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
------------------------------------------
Gemfile