Skip to content

Instantly share code, notes, and snippets.

View nrk's full-sized avatar
🤔
はい、猫のように見えます。

Daniele Alessandri nrk

🤔
はい、猫のように見えます。
View GitHub Profile
@nrk
nrk / gist:941578
Created April 26, 2011 00:50 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ParserDriver
{
public class Parser
{
public string Method;
@nrk
nrk / compl1.rb
Created September 10, 2010 17:39 — forked from antirez/compl1.rb
# 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)
<?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
*/
/*
namespace Helpers
{
using System;
/// <summary>
/// A static class of extension methods for <see cref="Array"/>.
/// </summary>
public static class ArrayHelpers
{
/// <summary>
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 {
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
# 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
@nrk
nrk / gist:323721
Created March 6, 2010 14:50 — forked from libc/gist:59086
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;
#!/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