This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def strrev(s) | |
| class TmpObject < ActiveRecord::Base | |
| acts_as_an_object_with_a_reversed_string_column :tmp | |
| end | |
| TmpObject.new(s).reversed_tmp | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/mman.h> | |
| #include <string.h> | |
| #define JIT_ALLOC_FUNC(size) \ | |
| (u8 *)mmap(NULL, size, PROT_READ|PROT_WRITE|PROT_EXEC, \ | |
| (MAP_PRIVATE|MAP_ANON), -1, 0) | |
| typedef unsigned char u8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def self.memoize_with_memcache(name) | |
| define_method "#{name}_with_memo" do | |
| key = [self.class.name, id.to_s] * '/' | |
| Cache.get(key) || Cache.put(key, name_without_memo) | |
| end | |
| alias_method_chain :name, :memo | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Process: Vim [2098] | |
| Path: /Applications/MacVim.app/Contents/MacOS/Vim | |
| Identifier: Vim | |
| Version: ??? (???) | |
| Code Type: X86 (Native) | |
| Parent Process: MacVim [2096] | |
| Date/Time: 2009-01-21 16:19:43.164 -0500 | |
| OS Version: Mac OS X 10.5.6 (9G55) | |
| Report Version: 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 2009-01-21 16:14:23.083 Vim[1983:10b] ERROR: Failed to load dictionaries. | |
| Most likely this is because you have symlinked directly to | |
| the Vim binary, which Cocoa does not allow. Please use an | |
| alias or the mvim shell script instead. If you have not used | |
| a symlink, then your MacVim.app bundle is incomplete. | |
| E254: Cannot allocate color Red | |
| E254: Cannot allocate color White | |
| E254: Cannot allocate color Blue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # List tweets w/ links. | |
| # require: sudo gem install jnunemaker-twitter --source http://gems.github.com | |
| # usage: twitlinks [num] | |
| require "rubygems" | |
| require "twitter" | |
| # EDIT THIS | |
| EMAIL = 'ur@emailz.com' | |
| PASSWORD = 'greenerpoop' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Error while running applet. | |
| processing/core/PApplet.java:1242:in `createGraphics': java.lang.RuntimeException: You need to use "Import Library" to add processing.opengl.PGraphicsOpenGL to your sketch. (NativeException) | |
| from processing/core/PApplet.java:1015:in `size' | |
| from processing/core/PApplet.java:959:in `size' | |
| from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0' | |
| from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke' | |
| from sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke' | |
| from java/lang/reflect/Method.java:585:in `invoke' | |
| from org/jruby/javasupport/JavaMethod.java:250:in `invokeWithExceptionHandling' | |
| from org/jruby/javasupport/JavaMethod.java:219:in `invoke' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From d8d28ef73fdd539e0d6a358b7e3f00ac5317842c Mon Sep 17 00:00:00 2001 | |
| From: macournoyer <macournoyer@gmail.com> | |
| Date: Wed, 19 Nov 2008 15:43:45 -0500 | |
| Subject: [PATCH] Fix presentable_for so longest presentable name is matched first. | |
| This makes sure subscripton_discount_ is matched before subscripton_. | |
| --- | |
| .../lib/active_presenter/base.rb | 2 +- | |
| 1 files changed, 1 insertions(+), 1 deletions(-) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User | |
| has_many :cats | |
| end | |
| class UserTest < Test::Unit::TestCase | |
| # Useless | |
| should_have_many :cats | |
| # Useful | |
| def test_should_add_a_cat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Memcache-like Invisible app | |
| STORE = {} | |
| with ":key" do | |
| put { STORE[params[:key]] = params[:value] } | |
| get { render STORE[params[:key]] } | |
| end | |