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
# | |
# [{:op=>"and"}, | |
# [{:op=>"="}, [{:path=>"hello"}, {:lit=>":ivan"}]], | |
# [{:op => "or"}, | |
# [{:op=>"="}, [{:path=>"test"}, {:lit=>":ivan"}]], | |
# [{:op => ">"}, [:path => "test3", {:list => ":ivan"}]]]] | |
# | |
# hello = :ivan and (test = :ivan or test3 = :ivan) | |
class Parser |
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 bash | |
echo "Ensuring directory" | |
mkdir -p ~/src/mono | |
cd ~/src/mono | |
curr=`pwd` | |
echo "Changed to $curr" | |
MONO_PREFIX=/usr/local/mono | |
cat << EOF > mono_env |
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
diff --git a/ext/hpricot_scan/hpricot_scan.rl b/ext/hpricot_scan/hpricot_scan.rl | |
index d9ea15c..60b62b3 100644 | |
--- a/ext/hpricot_scan/hpricot_scan.rl | |
+++ b/ext/hpricot_scan/hpricot_scan.rl | |
@@ -24,7 +24,7 @@ static VALUE mHpricot, rb_eHpricotParseError; | |
static VALUE cBaseEle, cBogusETag, cCData, cComment, cDoc, cDocType, cElem, cETag, cText, | |
cXMLDecl, cProcIns, symAllow, symDeny; | |
static ID s_ElementContent; | |
-static ID s_downcase, s_new, s_parent, s_read, s_to_str; | |
+static ID s_downcase, s_new, s_parent, s_read, s_to_str, s_force_encoding, s_set_encoding; |
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
# Export your Wordpress posts to Tumblr (also allows to delete some.) | |
# Author: Alexandre Solleiro <[email protected]> | |
# How-to: | |
# 1. Export your Wordpress posts (http://en.blog.wordpress.com/2006/06/12/xml-import-export/) | |
# 2. Edit the information below to match your settings | |
# 3. To import, type "ruby wordpress2tumblr.rb --run" in the command line | |
# 4. To delete some posts, type "ruby wordpress2tumblr.rb --delete 1,2,3,4" where 1,2,3,4 are post numbers. (Be careful not to use spaces between IDs) | |
# Edit these | |
WP_EXPORT_PATH = "./wordpress.2009-09-14.xml" # path to the Wordpress Export file |
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
require 'System.CoreEx, Version=1.0.2521.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
require 'System.Interactive, Version=1.0.2521.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
require 'System.Reactive, Version=1.0.2521.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
require 'System.Windows.Forms' | |
include System | |
include System::Collections::Generic | |
include System::Linq | |
include System::Windows::Forms |
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
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Linq; | |
using System.Linq.Expressions; | |
namespace Mono.Linq.Expressions { | |
public static class PredicateBuilder { |
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
namespace Helpers | |
{ | |
using System; | |
/// <summary> | |
/// A static class of extension methods for <see cref="Array"/>. | |
/// </summary> | |
public static class ArrayHelpers | |
{ | |
/// <summary> |
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
<?php | |
/* | |
* The code in this file is a modification of a file in | |
* the predis project, and is thus governed by the same | |
* license. For details, please see: | |
* | |
* http://github.com/nrk/predis/blob/master/LICENSE | |
*/ | |
/* |
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
# compl1.rb - Redis autocomplete example | |
# download female-names.txt from http://antirez.com/misc/female-names.txt | |
require 'rubygems' | |
require 'redis' | |
r = Redis.new | |
# Create the completion sorted set | |
if !r.exists(:compl) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ParserDriver | |
{ | |
public class Parser | |
{ | |
public string Method; |
OlderNewer