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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Circles</title> | |
<meta charset="utf-8" /> | |
<script> | |
var Point = function(x, y) { | |
this.x = x; | |
this.y = y; | |
} |
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
chars_for = { | |
'-': ['-'], | |
'0': ['0'], | |
'1': ['1'], | |
'2': ['A', 'B', 'C'], | |
'3': ['D', 'E', 'F'], | |
'4': ['G', 'H', 'I'], | |
'5': ['J', 'K', 'L'], | |
'6': ['M', 'N', 'O'], | |
'7': ['P', 'Q', 'R', 'S'], |
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
namespace FtpSubmitter | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.Composition; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Threading.Tasks; | |
using System.Windows; |
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 obj = { | |
member_missing: func(name) { | |
return "Member: {0}".with(name); | |
} | |
}; | |
println(obj.notExist); # Member: notExist | |
println(obj.has_member('notExist')); # False | |
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
#! | |
Output the combination of strings corresponding to a given phone number. | |
Only include those strings one of whose substrings must exist in the dictionary. | |
This script uses the Linux dictionary. | |
!# | |
load 'file.bk'; | |
var chars_for = { | |
'-': ['-'], |
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
func memoize(f) { | |
var cache = { | |
member_missing: func() { null } | |
}; | |
return func recur(n) { | |
cache[n] || (cache[n] = f(recur, n)); | |
}; | |
} | |
var fib = func(n) { |
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
#region License | |
// Copyright 2010 Buu Nguyen, Morten Mertner | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software |
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 Y = func(h) { | |
return func(f) { | |
f(f) | |
}(func(f) { | |
h(func(n) { f(f)(n) }) | |
}); | |
}; | |
var fact = Y(func(recur) { | |
return func(n) { |
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 | |
redis_version=2.6.14 | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.github.com/richid/5205684/raw/53476c5360702367a59907d04c32822c523fdfac/install-redis.sh | |
# chmod +x install-redis.sh | |
# ./install-redis.sh |