This file contains 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
<?php | |
/** | |
* Magento | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Open Software License (OSL 3.0) | |
* that is bundled with this package in the file LICENSE.txt. | |
* It is also available through the world-wide-web at this URL: | |
* http://opensource.org/licenses/osl-3.0.php |
This file contains 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
package com.stonespells.core; | |
import javax.microedition.lcdui.Graphics; | |
import javax.microedition.lcdui.Image; | |
public class Font { | |
// additional space between characters | |
public int charS = 0; | |
// max clipping area |
This file contains 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
require 'ar-extensions' | |
# ActiveRecord::Extensions fix for using ILIKE with PostgreSQL database | |
# | |
# Usage sample: | |
# User.find(:all, :conditions { :name_ilike => "%something%" }) | |
module ActiveRecord::Extensions | |
class ILike |
This file contains 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
# __ <`-,-,_,-, | |
# \_;> ^ _<---' | |
# ) _,-' | |
# / / | |
# __ ,' / | |
# )_\ _,-' / | |
# \_ _,-_-,_ _,-' / | |
# \_/\,_ ` `' \ | |
# /\,_ ` | | |
# |\,_` ) , < |
This file contains 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
## | |
# test/spec/mini 3 | |
# http://gist.github.com/25455 | |
# chris@ozmm.org | |
# file:lib/test/spec/mini.rb | |
# | |
def context(*args, &block) | |
return super unless (name = args.first) && block | |
require 'test/unit' | |
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do |
This file contains 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
DELETE FROM table1 | |
USING table1, | |
table1 as table2 | |
WHERE table2.id > table1.id | |
AND table2.unique_param = table1.unique_param |
This file contains 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
// This code was written by Tyler Akins and has been placed in the | |
// public domain. It would be nice if you left this header intact. | |
// Base64 code from Tyler Akins -- http://rumkin.com | |
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
function encode64(input) { | |
var output = new StringMaker(); | |
var chr1, chr2, chr3; | |
var enc1, enc2, enc3, enc4; |
This file contains 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
tweet = "Hi, you should follow @endel! http://bugfixer.endel.me is #cool :)"; | |
tweet = tweet.gsub(/(http\:\/\/[A-Za-z0-9\/\.\?\=\-]*)/,'<a href="\1">\1</a>'); | |
tweet = tweet.gsub(/@([A-Za-z0-9\/_]*)/,'<a href="http://twitter.com/\1">@\1</a>'); | |
tweet = tweet.gsub(/#([A-Za-z0-9\/\.]*)/,'<a href="http://twitter.com/search?q=\1">#\1</a>'); |
This file contains 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
tweet = "Hi, you should follow @endel! http://bugfixer.endel.me is #cool :)"; | |
tweet = tweet.replace(/(http\:\/\/[A-Za-z0-9\/\.\?\=\-]*)/g,'<a href="$1">$1</a>'); | |
tweet = tweet.replace(/@([A-Za-z0-9\/_]*)/g,'<a href="http://twitter.com/$1">@$1</a>'); | |
tweet = tweet.replace(/#([A-Za-z0-9\/\.]*)/g,'<a href="http://twitter.com/search?q=$1">#$1</a>'); |
This file contains 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
require 'resque' | |
Resque.workers.each{|worker| system("kill -QUIT #{worker.pid}") } |
OlderNewer