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
open System | |
let rec readUntilDone input = | |
match input with | |
| "42" -> 0 | |
|_ -> Console.WriteLine(input) | |
readUntilDone(Console.ReadLine()) | |
[<EntryPoint>] | |
let main args = |
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 MongoClient = require('mongodb').MongoClient; | |
var mapFn = function() { | |
emit(1, { length: this.length }); | |
} | |
var reduceFn = function(key, values) { | |
var sum = 0; | |
values.forEach(function(doc) { | |
sum += doc.length; |
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
# INSTRUCTIONS: | |
# - make sure you have ruby and phantomjs installed | |
# - gem install selenium-webdriver | |
# - start phantomjs in remote web driver mode: 'phantomjs --webdriver=4567' | |
# - change username/pass below | |
# - run the script (e.g. 'ruby defiance_ark_hunter.rb') | |
USERNAME = "user" | |
PASSWORD = "pass" |
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
#!/bin/bash | |
# Script for running tests on the continuous integration server. | |
set -e # exit on error | |
## Make sure latest gems are installed | |
bundle install | |
## Verify that asset precompilation works |
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 CdView = Backbone.View.extend({ | |
tagName: "li", | |
initialize: function() { | |
this.model.on("change" this.render); | |
}, | |
events: { | |
"click .icon": "open", |
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
#!/usr/bin/env ruby | |
require "active_support/all" | |
require "hashie" | |
require "nokogiri" | |
if ARGV.blank? | |
puts "Usage: #{$0} filename.xml" | |
exit 1 | |
end |
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
# -*- coding: utf-8 -*- | |
require 'test_helper' | |
class DirectorCell < Cell::Rails | |
attr_reader :count | |
def initialize(*) | |
super | |
@count = 0 | |
end |
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
<ul> | |
<% Dir.glob("views/[^_]*").each do |file| %> | |
<li><a href="/<%= file %>"><%= file %></a></li> | |
<% end %> | |
</ul> |
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 C(object): | |
... cattr = "hej" | |
... def __init__(self, name): | |
... self.cattr = name | |
... | |
>>> c = C("hi") | |
>>> d = C("hej") | |
>>> d.cattr | |
'hej' | |
>>> c.cattr |
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
$ TimblServer -f dimin.train -S 6060 | |
TiMBL Server 1.0.0 (c) ILK 1998 - 2010. | |
Tilburg Memory Based Learner | |
[...] |
NewerOlder