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
/* | |
* ESI Parser 1.00 - Poor Man's ESI | |
* | |
* - or - I'm tired of seeing the wrong thing in my browser while developing. | |
* | |
* This code provides a client-side ESI parsing capability. It was created | |
* to provide an easier way of developing and testing sites that use ESI | |
* when not behind the cache or other system that provides the ESI parsing. | |
* It requires jQuery (anything after v1.2 should be fine) | |
* |
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
SELECT CONCAT('ALTER TABLE `', t.`TABLE_SCHEMA`, '`.`', t.`TABLE_NAME`, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') as stmt | |
FROM `information_schema`.`TABLES` t | |
WHERE 1 | |
AND t.`TABLE_SCHEMA` = 'teamcity' | |
ORDER BY 1 |
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
Day job: Web Developer / Software Engineer | |
Favorite Ruby project: Rails | |
Open Source contributions: Minor patches/features in various libraries like ruby-oauth, redmine, radiant, spatial_adapter, jquery-autocomplete, etc | |
How do you use GitHub: Forking & patching OS projects and hosting toy projects |
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
Day job: Web Developer / Software Engineer | |
What is your language of choice: Ruby | |
Open Source contributions: Minor patches in various libraries like ruby-oauth, redmine, radiant, spatial_adapter, jquery-autocomplete, etc | |
How do you use GitHub: Forking & patching OS projects and hosting toy projects |
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 is a FUGLY hack to make multipart emails work with localized templates | |
# in the form of method_el_GR.text.plain.rhtml (or .erb). | |
# | |
# NOTE : This is tested against Rails 2.3.8 and is a very good candidate to break in 2.3.9 and up. | |
ActionMailer::Base.class_eval do | |
def create!(method_name, *parameters) #:nodoc: | |
initialize_defaults(method_name) | |
__send__(method_name, *parameters) | |
# If an explicit, textual body has not been set, we check assumptions. |
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
using System; | |
using System.Collections.Generic; | |
using System.Dynamic; | |
using System.Linq.Expressions; | |
// The class derived from DynamicObject. | |
public class DynamicDictionary : DynamicObject | |
{ | |
// The inner dictionary. | |
Dictionary<string, object> dictionary |
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
# override the ssh problem with this: | |
ssh user@host "/bin/bash -i" | |
# now fix the issue | |
rm -rf /dev/ptmx | |
mknod /dev/ptmx c 5 2 | |
chmod 666 /dev/ptmx | |
umount /dev/pts | |
rm -rf /dev/pts | |
mkdir /dev/pts |
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
class ItemFetcherWorker < BackgrounDRb::MetaWorker | |
set_worker_name :item_fetcher_worker | |
def create(args = nil) | |
end | |
def set_search(search) | |
@search = search | |
end | |
def fetch_query_and_items |
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
# Two point partial preservation crossover for PermutationGenotype, also known as Partially Mapped Crossover (PMX). | |
# | |
# The PMX proceeds by choosing two cut points at random: | |
# Parent 1: hkcefd bla igj | |
# Parent 2: abcdef ghi jkl | |
# | |
# The cut-out section defines a series of swapping operations to be performed on the second parent. | |
# In the example case, we swap b with g, l with h and a with i and end up with the following offspring: | |
# Offspring: igcdef bla jkh | |
# Performing similar swapping on the first parent gives the other offspring: |
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
var DB = { | |
init: function(){ | |
dojox.sql("CREATE TABLE IF NOT EXISTS received_messages (" | |
+ "id INTEGER PRIMARY KEY, " | |
+ "title TEXT NOT NULL, " | |
+ "content TEXT, " | |
+ "sender_name TEXT NOT NULL, " | |
+ "sender_id TEXT NOT NULL) "); | |
dojox.sql("CREATE TABLE IF NOT EXISTS local_draft_messages (" |
NewerOlder