Skip to content

Instantly share code, notes, and snippets.

@vendethiel
vendethiel / do.sjs
Last active January 2, 2016 01:29 — forked from int3/gist:4013740
coffee's do, fix for new sweet.js
macro $do {
rule {($($x = $y) (,) ...) $body} => {
(function ($x (,) ...) $body)($y (,) ...)
}
rule {$name ($($x = $y) (,) ...) $body} => {
(function $name ($x (,) ...) $body)($y (,) ...)
}
}
$do (a = 1, b = 2) {
@vendethiel
vendethiel / scheme.sjs
Last active January 2, 2016 01:29 — forked from disnet/scheme.sjs
scheme.sjs (forked from https://gist.github.com/disnet/3854258)
macro sexp {
rule {()} => {
;
}
rule {($p)} => {
$p
}
rule {($x $y)} => {
$x($y);
}
@vendethiel
vendethiel / do.sjs
Last active January 2, 2016 01:29 — forked from puffnfresh/do.sjs
do.sjs fixed for new sweet.js
macro $do {
rule { { $y:expr } } => {
$y
}
rule { { $x:ident <- $y:expr $rest ... } } => {
λ['>=']($y, function($x) {
return $do { $rest ... }
});
}
}
==============Osu! Collection File==============
Edited by: Vendethiel
Number of collections listed: 19
Collection 1: Train
http://osu.ppy.sh/b/185443/ nano - Omoide Kakera
http://osu.ppy.sh/b/202216/ HHHxMMxST - Oboro
http://osu.ppy.sh/b/206845/ Last Note. - Setsuna Trip (Short Ver.)
http://osu.ppy.sh/b/242002/ sweet ARMS - Date A Live (TV Size)
http://osu.ppy.sh/b/211732/ niki - WAVE
http://osu.ppy.sh/b/43655/ Kagamine Rin and Len - Trick and Treat
ForBody: [
o 'FOR Range ForExtra', -> extend {source: LOC(2) new Value($2)}, $3
o 'ForStart ForSource ForExtra', ->
$2.own = $1.own; $2.name = $1[0]; $2.index = $1[1]
extend $2, $3
]
ForStart: [
o 'FOR ForVariables', -> $2
o 'FOR OWN ForVariables', -> $3.own = yes; $3
package org.photon.login
import com.twitter.util.Future
import org.photon.common.Async
import java.sql.{PreparedStatement, Timestamp, ResultSet}
import org.joda.time.Instant
trait RepositoryComponentImpl[T, RepoT] {
implicit def timestamp2instant(t: java.sql.Timestamp) = new Instant(t.getTime)
implicit def instant2timestamp(i: org.joda.time.Instant) = new Timestamp(i.getMillis)
type Transaction = mutable.Builder[Any, _]
def transaction[R](fn: Transaction => R): Future[NetworkSession] = {
val builder = List.newBuilder[Any]
fn(builder)
@tailrec
def rec(fut: Future[NetworkSession], buf: List[Any]): Future[NetworkSession] = buf match {
case head :: tail => rec(fut flatMap {_.write(head)}, tail)
case Nil => fut
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
<?php
class XkcdParser
{
/* @var array $last Data of the latest comic */
private $last;
/* @var int $max Latest comic data ID */
private $max;
public function __construct()