Skip to content

Instantly share code, notes, and snippets.

@udkl
udkl / spec.clj
Last active April 16, 2022 23:20
;; https://www.pixelated-noise.com/blog/2020/09/10/what-spec-is/
;; API docs : https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
;; https://practical.li/clojure/clojure-spec/
;; Guide : https://clojure.org/guides/spec
;; https://corfield.org/blog/2019/09/13/using-spec/
;; https://www.cognitect.com/blog/2017/6/19/improving-on-types-specing-a-java-library
;; Example code
;; https://github.com/practicalli/leveraging-spec
;; braidchat : core/client/store.cljs, base/state.cljc (validation interceptors)
@udkl
udkl / RAILS_CHEATSHEET.md
Last active December 23, 2021 02:37 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@udkl
udkl / configure_shadowjar.sh
Created November 5, 2021 19:34
Shadowcljs hot reload websocket config for gitpod
#! /bin/sh
# This is a very crude way where you change the shadow cljs jar in the maven repo and repackage it
cd '/home/gitpod/.m2/repository/thheller/shadow-cljs/2.15.12'
# unzip to directory called out
unzip shadow-cljs-2.15.12-aot.jar -d out
mv shadow-cljs-2.15.12-aot.jar shadow-cljs-2.15.12-aot-backup.jar
@udkl
udkl / sh
Created September 22, 2020 22:22
sh in the terminal - looping through all files in the current dir and running a command
for i in *.html ; do echo "$i" && pandoc -s ./$i -o ./output/$i.md ; done
@udkl
udkl / aoc_2015_day2.js
Created March 17, 2017 04:01
Advent of code 2015 - Day 2
function parseDimension(dimension) {
var packageDimensions = dimension.split("x");
return packageDimensions;
}
function numericSort(a, b) {
if (a < b) return -1;
if (a > b) return 1;
return 0;
@udkl
udkl / git-change-commit-messages.md
Created July 4, 2016 20:57 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git?

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@udkl
udkl / Basic AMD module using the CommonJS format
Created January 1, 2014 19:15
A boilerplate for creating a AMD module using the CommonJS format.
define(function (require) {
// import dependencies
var defineComponent = require('./lib/component');
// export component constructor
return defineComponent(helloWorld);
// component definition
function helloWorld () {};
@udkl
udkl / TiddlyWikiHelperMacros
Last active January 1, 2016 22:19
Collection of Macros used across TiddlyWiki files. It's on gist because of the need of a central place to update the macros and then copy into other tiddlyWikis.
config.macros.hero= {};
config.macros.hero.handler = function (place,macroName,params,wikifier,paramString,tiddler) {
var heroText= params.length > 0 ? params[0] : "BLANK";
wikify("__@@''"+heroText+"''@@__", place);
}
config.macros.insight= {};
config.macros.insight.handler = function (place,macroName,params,wikifier,paramString,tiddler) {
@udkl
udkl / top_shadow
Created July 20, 2012 05:21
Top Shadow to HTML page
body:before {
content: "";
position: fixed;
top: -10px;
left: 0;
width: 100%;
height: 10px;
-webkit-box-shadow: 0px 0px 10px rgba(0,0,0,.8);
-moz-box-shadow: 0px 0px 10px rgba(0,0,0,.8);
@udkl
udkl / gist:2410176
Created April 18, 2012 00:47
CSS - Threadflip - Description text
font-family "mreavesmod","Helvetica Neue",Arial,Helvetica,sans-serif
font-size 20px
font-weight 400
font-style normal
font-size-adjust none
color #333333
text-transform none
text-decoration none
letter-spacing normal
word-spacing 0