Skip to content

Instantly share code, notes, and snippets.

@jlebrech
jlebrech / gist:1012717
Created June 7, 2011 17:37
brew doctor
You have a non-brew 'pkg-config' in your PATH:
/usr/bin/pkg-config
`./configure` may have problems finding brew-installed packages using
this other pkg-config.
Your pkg-config is not checking "/usr/X11/lib/pkgconfig" for packages.
Earlier versions of the pkg-config formula did not add this path
to the search path, which means that other formula may not be able
to find certain dependencies.
@jlebrech
jlebrech / MainActivity.java
Created May 26, 2011 10:54
Loading sqlite into a listview
package com.jlebrech;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.ListView;
import android.widget.ArrayAdapter;
@jlebrech
jlebrech / error
Created May 20, 2011 10:39
routes rest?
Unknown action
The action 'show' could not be found for FriendshipsController
@jlebrech
jlebrech / _form.html.haml
Created May 19, 2011 14:13
Intra user messaging
= simple_form_for(@memo) do |f|
- if @memo.errors.any?
#error_explanation
%h2
= pluralize(@memo.errors.count, "error")
prohibited this memo from being saved:
%ul
- @memo.errors.full_messages.each do |msg|
%li= msg
@jlebrech
jlebrech / friends.haml
Created May 13, 2011 14:38
friends.haml
.friends-in
%h1 Friends In
- @friends_in.each do |friendship|
%p
=friendship.friend.login
=link_to "remove", friendship, :method => :delete
=link_to "accept", friendship, :method => :put
@friends_out = Friendship.where(:user_id=>current_user.id) #users "i" want to be friends with
@friends_in = Friendship.where(:friend_id=>current_user.id) #users who want to be friend with "me"
# users who haven't added "my" id to Friendship and vice versa
# user who are my friend and i'm their friends.
@jlebrech
jlebrech / friend.haml
Created May 12, 2011 11:44
friend not accessible
.friends
- @user.friendships.each do |friendship|
%p
=friendship.friend.login
=link_to "remove", friendship, :method => :delete
.friends
- @user.friendships.each do |friendship|
%p=friendship.friend.login
-link_to "remove", friendship, :method => :delete
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
IBOutlet CPButtonBar buttonBar;
IBOutlet CPToolbar toolBar;
}
@import "attributeEditController.j"
...
attribController = [[AttributeEditController alloc] initWithCibName:"attributeEditController" bundle:nil];
[verticalSplitter addSubview:[attribController view]];