Skip to content

Instantly share code, notes, and snippets.

Avatar

Stuart Stein stuartstein777

View GitHub Profile
View UserContent.css
/* 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 Mar 12, 2022
Can I not hot reload the graph?
View reloading-graph.cljs
(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 Dec 12, 2021
AOC 2021 Day 11 in Clojure
View 2021-day-11.clj
(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 Dec 5, 2021
advent of code 2021 day 5
View 2021-day5.clj
(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)
View 2021-day-4-part2.clj
(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)))
View gist:e0af631b8b151fa2e401fa24189e4264
(({: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
View 2021-day4-part-1.clj
(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 Nov 29, 2021
Firefox css to expand / collapse TST
View userChrome.css
@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;
View gist:3855d08f91e9229f96d99c47028ee921
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.
View suggest.md
.macros
   %square-and-sum
      mul %1 %1
      muk %2 %2    ;---- should be mul
      add %1 %2
   %end
   %add-ten
      add %1 10
   "%end