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
package autoApplicativeBuilder | |
import shapeless.CaseClassMacros | |
import scala.annotation.StaticAnnotation | |
import scala.language.existentials | |
import scala.language.experimental.macros | |
import scala.reflect.internal.annotations.compileTimeOnly | |
import scala.reflect.macros.Context |
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
(for [[a b] [[1 2] [3 4] [5 6]] :when (> a 1)] (* a b)) | |
;; expand | |
(let* | |
[iter__4590__auto__ | |
(fn* | |
iter__8366 | |
([s__8367] | |
(new |
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
(ns cdl.graph | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic][clojure.core.logic.pldb]) | |
(:require [clojure.core.logic.fd :as fd])) | |
;; taken from cypher examples ... | |
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
(def a 10) ;; assign 10 to a | |
a ;=> 10 | |
(inc a) ;=> 11 | |
(inc (inc a)) ;=> 12 | |
a ;=> 10 |
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 | |
IN=$1 | |
OUT="TODELETE_$1" | |
read_dom () { | |
local IFS=\> | |
read -d \< ENTITY CONTENT | |
local RET=$? | |
TAG_NAME=${ENTITY%% *} |
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
import java.util.Arrays; | |
import java.util.Scanner; | |
public class G2048 { | |
static char EMPTY = ' '; | |
static String UP = "UP"; | |
static String DOWN = "DOWN"; | |
static String LEFT = "LEFT"; | |
static String RIGHT = "RIGHT"; | |
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 TestUtils { | |
public static void should(boolean b){ | |
if(!b) { | |
throw new RuntimeException("failed"); | |
} | |
} | |
} |
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 Vect { | |
final double x; | |
final double y; | |
Vect(double x, double 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
(defmacro defmodule | |
[name slots & specs] | |
(let [fields (->> slots (partition 2) (map first) vec) | |
defaults (->> slots (partition 2) (map second)) | |
pdef (map (partial take 2) specs) | |
pname (symbol (str "I" name))] | |
`(do | |
(defprotocol ~pname ~@pdef) | |
(defrecord ~name ~fields ~pname ~@specs) |
OlderNewer