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 introspect | |
(:require [clindex.api :as clindex] | |
[clindex.forms-facts.core :as forms-facts] | |
[clindex.utils :as clindex-utils] | |
[datascript.core :as d] | |
[clojure.pprint :as pprint] | |
[clojure.walk :as w] | |
[clojure.java.io :as io] | |
[clojure.string :as str])) |
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
float udBox( vec3 p, vec3 b ) { | |
return length(max(abs(p)-b,0.0)); | |
} | |
float sdTorus( vec3 p, vec2 t ) | |
{ | |
vec2 q = vec2(length(p.xz)-t.x,p.y); | |
return length(q)-t.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
void setup() { | |
size(1100, 600); | |
} | |
enum Axis { X, Y }; | |
void setGradient(int x, int y, float w, float h, color c1, color c2, Axis axis ) { | |
noFill(); |
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 Circle { | |
PVector center; | |
float radius; | |
public Boolean intersects(ArrayList<Circle> circles) { | |
for(Circle other : circles) { | |
if(this.center.dist(other.center) <= (other.radius + this.radius)) { | |
return true; | |
} |
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 sys | |
import argparse | |
import tty | |
import termios | |
def getch(): | |
fd = sys.stdin.fileno() | |
old_settings = termios.tcgetattr(fd) | |
try: | |
tty.setraw(sys.stdin.fileno()) |
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
; How to accomplish this so that the generator works as well? | |
(ns voting.core | |
(:require [clojure.spec :as s] | |
[clojure.spec.gen :as gen])) | |
(defn valid-card? [s] | |
(-> (loop [n 0 s (sort s)] | |
(if (empty? s) n | |
(when (= (inc n) (first s)) (recur (inc n) (next s))))) | |
(integer?))) |
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 megakolmio.core | |
(:gen-class)) | |
(defn match-side? | |
"Check if given sides match each other" | |
[s1 s2] | |
(case s1 | |
:fox-bottom (= s2 :fox-top) | |
:deer-bottom (= s2 :deer-top) | |
:racoon-bottom (= s2 :racoon-top) |
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 pairs.core | |
(:require [clojure.string :as str] | |
[clojure.math.combinatorics :as combo])) | |
(def letters (map identity "pairs")) | |
(defn name->counts [name] | |
(reduce | |
(fn [acc value] | |
(if-not (nil? value) |
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
void main(void) | |
{ | |
vec2 n = 2.0 * (gl_FragCoord.xy / iResolution.xy) - 1.0; | |
vec2 uv = vec2(0,0); | |
float theta = iGlobalTime * 0.2; | |
uv.x = cos(theta) * n.x + sin(theta) * n.y; | |
uv.y = -sin(theta) * n.x + cos(theta) * n.y; | |
vec4 v = texture2D(iChannel0, vec2(0.0,iChannelTime[0])); |
NewerOlder