Skip to content

Instantly share code, notes, and snippets.

@mike-thompson-day8
mike-thompson-day8 / debug.md
Last active May 23, 2016 16:58
An alternative to the offical re-frame debug middleware
(defn debug-cljs-devtools
  "This is a drop-in alternative for the offical re-frame `debug` middleware
  It is better because: 
    - it writes data, rather than strings, to js/console. This better leverages  
      the power of cljs-devtols.
    - it exploits js/console's ability to colorize text, hopefully making the 
      output easier to grok."
  [handler]
 (fn debug-handler
(ns full.binding-test
#?(:cljs (:require [cljs.core.async :refer [<! chan onto-chan]]
[zones.core :as zones :include-macros true]))
#?(:cljs (:require-macros
[full.async :refer [<<!]]
[full.binding-test :refer
[new-bound-fn create-vars new-binding]]
[cljs.core.async.macros :refer [go go-loop]])))
#?(:cljs (enable-console-print!))
@taylorSando
taylorSando / pr-opts.cljs
Created February 8, 2016 15:07
A way to have better function output using pr-str
;; Using defonce, because in a reloaded workflow, only want this to run once
;; Changes the default printing of the javascript source code of a function to just the function name.
;; Changes instances of dollar sign to dot, and underscores to hyphens.
;; cljs$core$pr_str would be cljs.core.pr-str instead
(defonce
ugly-pr-opts-hack
(set!
cljs.core/pr-opts
(let [old-pr-opts (cljs.core/pr-opts) ]
(fn []
@mfikes
mfikes / scljs.md
Last active December 29, 2015 10:47
State of ClojureScript

If you look at the 2014 State of ClojureScript survey, these are the top items for What has been most frustrating for you in your use of CLJS?, and my take on work done in these areas is below. It is nothing short of amazing, IMHO.

Therefore I urge you to do the current survey.

  1. Difficulty using ClojureScript REPL: The Node.js REPL was added, as well as a Nashorn REPL, as well as a lot of new "ease-of-use" stuff baked into all base REPLs (doc, pst, etc.). Additionally, a few new ClojureScript REPLs (Ambly, Replete, Planck) rely heavily on new stuff in ClojureScript.
  2. Difficulty debugging generated JavaScript: Source map capability was essentially extended to all REPLs with stack traces automatically being mapped. The
@pxsta
pxsta / tmux-highlight-text-patch-LICENSE
Last active September 17, 2025 18:47
tmux-highlight-text.patch enables tmux to highlight the text like iTerm2.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
module main
data FormatString : List Char -> Type -> Type where
Empty : FormatString [] String
InsertNumber : FormatString s t -> FormatString ('%' :: 'd' :: s) (Int -> t)
InsertString : FormatString s t -> FormatString ('%' :: 's' :: s) (String -> t)
Other : (x /= '%' = True) -> FormatString s t -> FormatString (x :: s) t
printf' : List Char -> FormatString format ty -> ty
printf' s Empty = pack (reverse s)
@darwin
darwin / script.sh
Last active March 22, 2019 17:53
Delete Finder + TotalFinder preferences safely. Please execute this line by line in your Terminal.app window.
osascript -e "tell application \"Finder\" to quit"
rm ~/Library/Preferences/com.apple.finder.plist
rm ~/Library/Preferences/com.binaryage.totalfinder.plist
@oleganza
oleganza / impulse_review.md
Last active January 23, 2016 06:24
Impulse Review

(That's my attempt to understand what problem Impulse solves and how. I am not a designer/developer of this scheme.)

Problem

Regular Bitcoin transactions are not guaranteed until mined sufficiently deep in the blockchain. Unconfirmed transactions can be observed nearly instantly, but they cannot be trusted (could drop out because of insufficient fees, or double-spent).

Impulse Overview

@paulirish
paulirish / args.gn
Last active May 17, 2024 00:09
How to build Chromium to hack on DevTools
# Build arguments for the gn build
# You can set these with `gn args out/Default`
# ( and they're stored in src/out/Default/args.gn )
# See "gn args out/Default --list" for available build arguments
# component build, because people love it
is_component_build = true
# release build, because its faster
is_debug = true