Skip to content

Instantly share code, notes, and snippets.

View stuartstein777's full-sized avatar

Stuart Stein stuartstein777

View GitHub Profile
/* Removes white loading page */
@-moz-document url(about:blank), url(about:newtab), url(about:home) {
html:not(#ublock0-epicker), html:not(#ublock0-epicker) body, #newtab-customize-overlay {
background: #1d2021 !important;
}
}
@stuartstein777
stuartstein777 / reloading-graph.cljs
Created March 12, 2022 14:42
Can I not hot reload the graph?
(ns exfn.app
(:require [reagent.dom :as dom]
[re-frame.core :as rf]
[goog.string.format]
["cytoscape" :as cytoscape]))
(defn cytoscape-clj [graph-options elements container-id]
(cytoscape
(clj->js (merge graph-options
{:container (js/document.getElementById container-id)
@stuartstein777
stuartstein777 / 2021-day-11.clj
Created December 12, 2021 01:40
AOC 2021 Day 11 in Clojure
(ns stuartstein777.2021.day11
(:require [stuartstein777.file :as f]
[stuartstein777.utils :as u]
[clojure.string :as str]))
(defn xy->idx
[width [x y]]
(+ y (* x width)))
(defn parser [line]
@stuartstein777
stuartstein777 / 2021-day5.clj
Created December 5, 2021 14:25
advent of code 2021 day 5
(ns stuartstein777.2021.day5
(:require [clojure.string :as str]
[clojure.set :as set]
[stuartstein777.file :as f]
[stuartstein777.utils :as u]))
(defn parser [line]
(let [[x1 y1 x2 y2] (->> line
(re-seq #"(\d+),(\d+) -> (\d+),(\d+)")
(u/frest)
@stuartstein777
stuartstein777 / 2021-day-4-part2.clj
Created December 4, 2021 19:54
AOC 2021 Day 4 Pat 2
(ns stuartstein777.2021.day4
(:require [clojure.string :as str]
[clojure.set :as set]
[stuartstein777.file :as f]
[stuartstein777.utils :as u]))
(defn winning-board? [board]
(or (row-matched? board)
(column-matched? board)))
(({:n 14, :called false} {:n 86, :called false} {:n 50, :called false} {n 89, :called false} {:n 49, :called false}
{:n 10, :called false} {:n 85, :called false} {:n 33, :called false} {:n 46, :called false} {:n 87, :called false}
{:n 82, :called false} {:n 91, :called false} {:n 54, :called false} {:n 13, :called false} {:n 90, :called false}
{:n 63, :called false} {:n 88, :called false} {:n 75, :called false} {:n 99, :called false} {:n 79, :called false}
{:n 74, :called false} {:n 31, :called false} {:n 4, :called false} {:n 0, :called false} {:n 71, :called false})
({:n 56, :called false} {:n 3, :called false} {:n 70, :called false} {:n 2, :called false} {:n 22, :called false}
{:n 44, :called false} {:n 63, :called false} {:n 10, :called false} {:n 95, :called false} {:n 8, :called false}
{:n 92, :called false} {:n 62, :called false} {:n 83, :called false} {:n 4, :called false} {:n 93, :called false}
{:n 74, :called false} {:n 80, :called false} {:n 5, :called false} {:n 11, :called fa
@stuartstein777
stuartstein777 / 2021-day4-part-1.clj
Created December 4, 2021 17:55
2021-day-4-part 1
(ns stuartstein777.2021.day4
(:require [clojure.string :as str]
[clojure.set :as set]
[stuartstein777.file :as f]
[stuartstein777.utils :as u]))
(defn print-board [board]
(println (str/join "\n" (->> board
(partition 5)
(map (fn [x]
@stuartstein777
stuartstein777 / userChrome.css
Created November 29, 2021 21:22
Firefox css to expand / collapse TST
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#TabsToolbar {
visibility: collapse !important;
}
/*Collapse in default state and add transition*/
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] {
overflow: hidden;
min-width: 40px;
max-width: 40px;
stuarts@x-lap-562:/mnt/c/Users/stuarts/Source/___TESTREPOS/__Clojure/tic-tac-toe-re-frame$ shadow-cljs classpath
shadow-cljs - config: /mnt/c/Users/stuarts/Source/___TESTREPOS/__Clojure/tic-tac-toe-re-frame/shadow-cljs.edn
WARNING: The com.cognitect/transit-clj dependency in shadow-cljs.edn was ignored. Default version is used and override is not allowed to ensure compatibility.
The versions provided by shadow-cljs can be found here: https://clojars.org/thheller/shadow-cljs/versions/2.11.22
src/dev:src/main:src/test:/home/stuarts/.m2/repository/com/bhauman/cljs-test-display/0.1.1/cljs-test-display-0.1.1.jar:/home/stuarts/.m2/repository/com/rpl/specter/1.1.3/specter-1.1.3.jar:/home/stuarts/.m2/repository/org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar:/home/stuarts/.m2/repository/org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar:/home/stuarts/.m2/repository/com/google/protobuf/protobuf-java/3.11.1/protobuf-java-3.11.1.jar:/home/stuarts/.m2/repository/org/clojure/google-closure-library-third-party/0.
@stuartstein777
stuartstein777 / suggest.md
Created May 12, 2021 08:05
parser suggests
.macros
   %square-and-sum
      mul %1 %1
      muk %2 %2    ;---- should be mul
      add %1 %2
   %end
   %add-ten
      add %1 10
   "%end