Skip to content

Instantly share code, notes, and snippets.

@ooesili
ooesili / core.clj
Created November 28, 2018 04:28
Circles
(ns quils.circles.core
(:require [quil.core :as q]))
(defmacro with-matrix [& body]
`(do
(q/push-matrix)
(try
~@body
(finally (q/pop-matrix)))))
@ooesili
ooesili / core.clj
Created November 27, 2018 22:13
Circles
(ns quils.circles.core
(:require [quil.core :as q]
[quils.util :refer :all]))
(def TAU (* 2 q/PI))
(def max-depth 4)
(defn setup []
(q/frame-rate 1)
(q/color-mode :hsb)
@ooesili
ooesili / error.log
Created February 11, 2018 21:28
Rust channel sender error
error[E0308]: mismatched types
--> src/lib.rs:15:24
|
15 | self.chan.send(w);
| ^ expected type parameter, found a different type parameter
|
= note: expected type `A`
found type `W`
error: aborting due to previous error
@ooesili
ooesili / keybase.md
Created May 13, 2017 00:27
Keybase Verification

Keybase proof

I hereby claim:

  • I am ooesili on github.
  • I am ooesili (https://keybase.io/ooesili) on keybase.
  • I have a public key whose fingerprint is 3EBF BE6F 7FBF 4B2E D07C E8C4 36EB 38D4 9582 35DA

To claim this, I am signing this object:

@ooesili
ooesili / main.rb
Created April 3, 2015 14:52
Roman Numerals
#!/usr/bin/env ruby
########## GRAB AND VALIDATE INPUT ##########
num_str = STDIN.gets.chomp
if not (1..4999).include? num_str.to_i
warn "number must be between 1 and 4999 (inclusive)"
exit 1
end
########## PAIR UP DIGITS WITH NUMERALS ##########
@ooesili
ooesili / pkgclean.hs
Created April 30, 2014 21:37
What Arch packages are installed?
import System.Process
import Data.List
type Package = String
type Group = String
type GroupSpec = (Group, [Package])
main :: IO ()
main = do
---- get data from pacman
@ooesili
ooesili / htop-1.0.3-vi.patch
Created April 25, 2014 15:07
vi keybindings for htop-1.0.3; adapted from a patch written by Evan LeCompte - https://github.com/Evanlec
diff --git a/Panel.c b/Panel.c
index 26b1190..05f7bc7 100644
--- a/Panel.c
+++ b/Panel.c
@@ -343,11 +343,13 @@ bool Panel_onKey(Panel* this, int key) {
assert (this != NULL);
switch (key) {
case KEY_DOWN:
+ case 'j':
case KEY_CTRLN:
@ooesili
ooesili / htop-1.0.3-solarized.patch
Created April 25, 2014 15:03
solarized patch for htop-1.0.3; adapted from https://gist.github.com/alexeiz/4657334
diff --git a/CRT.c b/CRT.c
index c0d1b82..f8d5f70 100644
--- a/CRT.c
+++ b/CRT.c
@@ -587,7 +587,7 @@ void CRT_setColors(int colorScheme) {
CRT_colors[LED_COLOR] = ColorPair(Green,Black);
CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
CRT_colors[PROCESS] = A_NORMAL;
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Green,Black);
import Control.Monad
import Data.List
-- type synonyms for convenience
type Board = (Int, Int)
type Pos = (Int, Int)
type Obstacle = Pos
type Path = [Pos]
---------- DIRTY INPUT FUNCTIONS ----------