Skip to content

Instantly share code, notes, and snippets.

Jérémie Grodziski jgrodziski

Block or report user

Report or block jgrodziski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View promesa-retry.cljs
(ns promesa-retry
(:require
["util" :refer [format]]
[promesa.core :as p :refer [reject! resolve!] :refer-macros [alet await]]
[promesa.async-cljs :refer-macros [async]]
[cljs.test :as t :include-macros true]))
(defn backoff-duration [retries-count interval]
(+ (* interval retries-count) (rand-int interval)))
View carmack_on_inputs.md

From https://github.com/ESWAT/john-carmack-plan-archive/blob/master/by_day/johnc_plan_19981014.txt Layout - like bold - is my own.

It has been difficult to write .plan updates lately. Every time I start writing something, I realize that I'm not going to be able to cover it satisfactorily in the time I can spend on it. I have found that terse little comments either get misinterpreted, or I get deluged by email from people wanting me to expand upon it.

I wanted to do a .plan about my evolving thoughts on code quality and lessons learned through quake and quake 2, but in the interest of actually completing an update, I decided to focus on one change that was intended to just clean things up, but had a surprising number of positive side effects.

Since DOOM, our games have been defined with portability in mind. Porting to a new platform involves having a way to display output, and having the platform tell you about the various relevant inputs. **There are four principle inputs to a game: keystrokes, mouse moves

View .spacemacs
; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
View install-java.sh
#!/bin/bash
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo bash -c "echo JAVA_HOME="/usr/lib/jvm/java-8-oracle" >> /etc/environment"
java -version
@jgrodziski
jgrodziski / postgres.clj
Last active Jan 16, 2018
Hugsql automatic renaming keys from "snake" to "kebab" using postgres.async and core.async channels
View postgres.clj
(def xform (map (partial transform-keys ->kebab-case-keyword)))
(defn result-one-snake->kebab
[this result options]
(let [return-chan (chan)]
(pipeline 1 return-chan xform (result-one this result options))
return-chan))
(defmethod hugsql.core/hugsql-result-fn :1 [sym] 'org.myapp.db.postgres/result-one-snake->kebab)
(defmethod hugsql.parameters/apply-hugsql-param :i [param data options] 'org.myapp.db.postgres/result-one-snake->kebab)
View keybase.md

Keybase proof

I hereby claim:

  • I am jgrodziski on github.
  • I am jgrodziski (https://keybase.io/jgrodziski) on keybase.
  • I have a public key whose fingerprint is 5A99 EE65 A0A4 7587 5EB1 EC89 C915 208B FDD0 637E

To claim this, I am signing this object:

@jgrodziski
jgrodziski / settings.xml
Created Sep 10, 2017
maven settings.xml including clojars repo
View settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers/>
View install-zsh.sh
#!/bin/bash
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sudo chsh -s /bin/zsh
curl https://gist.githubusercontent.com/jgrodziski/7405347/raw/f9bf15d5e2779417985d9137c3f5cb932b4858fb/jerem.zsh-theme -o ~/.oh-my-zsh/themes/jerem.zsh-theme
# then change these two lines in .zshrc
# ZSH_THEME="jerem"
# plugins=(git docker osx sublime mvn ssh-agent lein brew dircycle history jump z autojump zsh-syntax-highlighting)
View install-java.sh
#!/bin/bash
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo bash -c "echo JAVA_HOME="/usr/lib/jvm/java-8-oracle" >> /etc/environment"
java -version
@jgrodziski
jgrodziski / docker-aliases.sh
Last active Sep 5, 2019
Useful Docker Aliases
View docker-aliases.sh
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
You can’t perform that action at this time.