Skip to content

Instantly share code, notes, and snippets.

View kouphax's full-sized avatar

James Hughes kouphax

View GitHub Profile
@kouphax
kouphax / encoded_fonts.edn
Last active December 26, 2023 12:36
font awesome fonts -> base64 encoded data uri -> edn/sql
{"fa-adjust" "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAABQCAYAAABPlrgBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAACARJREFUeJztnHtsFNcZxc+5u9jmoTogWnv9XptCY6hoVbW0TRUqpJBETaOoCCSUKm1pI0X8EUUkFSnYjBYb8kBIRWmFAlKiRKQgQlpRSkTVKqRUbXFU2obwKGB2edi7mFKTFgzG3p3TP8CEhx93dnd215V/f3lmvu+7Z4/Xd+beO9fAGGOMMcYYvsJcNRRzaktKXM4WArMFTQdQS6IMQimo8QIMxX5Blwl2A+oEGIXBESL1t/LI6dMElAutvpkigOec+ply8RiI+ZDmgCzKoF6CwnsidhfT7J4aaf9vNvXeStZNOf18zeRxRYHvS1hCcla26wMAhF5AO2m4qTwS3Zvtb1DWTDm/oiaUDASWA3wSxIRs1R0R4SDlrikPnNrBCNxslMzYlMSzZRPdCRN/QmIZgPFZ0JQewj8ILgu1nNybaamMTEk44Ufk8ucgajIVkjWkrTR8JhSJnk+3RFqmdDmNk1Lq3QBgSboN+4mgf0n4YVVLbFc6+Z5N6Wiqm2GM2QlgRjoN5hJJ6ypMzQpG/pD0kufJlE6nbj5cvk3yU97k5Q9Je4p6ixZ9et2xS7Y51qYkVoUXusBbBMelJy+f6IDbV/xg1Yv//LdNtJUpiaa6RS7NVhImI2mAKHwoqM0QH4mMATgvpC7TDWwG8Y1M6o/Q+EG3v2iejTEjmhJvrn9Y0K9JBtPWI70v8k0yuKsycvzCoO2sqt8D4MF027DSAbSBV+dVRhJXhosb9oMmmhpmunC3p2OIBBfUFjLwUuXq9iNe8/2AwBxp/JtysGi4B70hP2z38vrSq8bdSXCS18YlvR8Qny5viX3kNddvCCyIu+HngdjaoWIG7SMEsLdIGwk2eGzzKoCnKlpi88pbowVnyCewpbO5/r6hrg5q
@kouphax
kouphax / Darcula.itermcolors
Created January 24, 2013 22:27
Jetbrains IntelliJ IDEA Darcula Theme ported to iTerm2 colour scheme. WIP.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.16300885379314423</real>
<key>Green Component</key>
<real>0.16304571926593781</real>
@kouphax
kouphax / core.clj
Created September 21, 2014 21:41
A sampling of Clojure syntax (grabbed elsewhere but I've lost the source)
; Comments start with semicolons.
; Clojure is written in "forms", which are just
; lists of things inside parentheses, separated by whitespace.
;
; The clojure reader assumes that the first thing is a
; function or macro to call, and the rest are arguments.
;
; Here's a function that sets the current namespace:
(ns test)
public class PasswordsMustMatchAttribute : ValidationAttribute
{
protected override ValidationResult IsValid(
object value, ValidationContext validationContext)
{
var model = validationContext.ObjectInstance as Person;
if (model.Password == model.PasswordConfirm)
{
return ValidationResult.Success;
}
package parsers;
import com.fasterxml.jackson.databind.JsonNode;
import helpers.Assertions;
import org.junit.Test;
import play.http.HttpErrorHandler;
import play.libs.F;
import play.mvc.BodyParser;
import play.mvc.Http;
import play.mvc.Result;
trait HomingPigeonPowers {
val flyHome = (_:Any) => Results.Redirect(routes.Application.index())
}
@kouphax
kouphax / billyelliot.zsh-theme
Created November 7, 2013 13:33
Modified robbyrussel theme for oh-my-zsh
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=":$(git_prompt_short_sha)%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=":$(git_prompt_short_sha)%{$fg[blue]%})"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
@kouphax
kouphax / README.md
Last active December 20, 2015 19:19 — forked from mbostock/.block
Workflow Visualisation

Trying to design a visualisation for a linear flow

I am preparing a new video series that focuses on comparing and contrasting five technologies. This will be done over a number of episodes. However I am not sure of the overall format. Would you rather
1. Spend each episode on all the features of a single technology?
2. Spend each episode on looking at 1 or 2 features across all the technologies?
Thanks in advance
James
@kouphax
kouphax / Main.scala
Last active December 16, 2015 08:39
Basic Sample of how to avoid the now deprecated ServerConfig. `Main.scala` has all the stuff for running the app and `dev.scala` is the config you pass in.
package se.yobriefca
import com.twitter.ostrich.admin.{AdminServiceFactory, RuntimeEnvironment}
import com.twitter.finagle.builder.{ServerBuilder, Server}
import com.twitter.finagle.http.Http
import java.net.InetSocketAddress
import com.twitter.finagle.stats.OstrichStatsReceiver
import com.twitter.finagle.Service
import org.jboss.netty.handler.codec.http._
import com.twitter.util.{Eval, Config, Future}