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 / README.md
Last active August 29, 2015 13:57
Ungisting Files and Tidying up Metadata

This gist covers

  • some of the snippets of code that was used to remove the gists from generated pages.
  • The tidying up of metadata and project strcuture
@kouphax
kouphax / README.md
Last active August 29, 2015 13:57
Clojure work to reomve embedded gists and replace with code blocks

Not a big fan of the my old embedded gists in posts so lets get them outta here.

  • Find all posts (historical ones) that have gists
  • Get the raw gist content and possibly syntax type (probably via api)
  • syntax highlight that
  • replace script tags (and noscript tags) with the generated syntax highlights code in a pre tag
  • win big
  • hilary
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kouphax
kouphax / calendars.clj
Created March 13, 2014 11:22
Build calendars for things in Clojure
(ns evident.core
(require [clj-time.core :as time]))
(declare in-same-month?)
(declare first-day-of-week)
(declare weekyears-between)
(defn week-calendar
"Given a starting date this function will return a LazySeq of the enclosing date
for the same month of the start-date. Week days that are not in the the same
@kouphax
kouphax / scrape.clj
Created March 10, 2014 13:21
scrapes the download links for qcon2014 slides
(ns qcon2014.core
(require [net.cgrand.enlive-html :refer [html-resource select]]))
(defn get-slide-links []
(->> ["wednesday" "thursday" "friday"]
(map #(str "http://qconlondon.com/london-2014/schedule/" % ".jsp"))
(map #(html-resource (java.net.URL. %)))
(mapcat #(select % [:a]))
(filter #(= (:content %) '("Download slides")))
(map #(get-in % [:attrs :href]))
@kouphax
kouphax / Application.scala
Created March 9, 2014 16:24
Some JSON magic in Play.
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.functional.syntax._
object Application extends Controller {

Keybase proof

I hereby claim:

  • I am kouphax on github.
  • I am kouphax (https://keybase.io/kouphax) on keybase.
  • I have a public key whose fingerprint is E78D C727 7FAF CC48 C02D 7C50 997E 28FC 90EB DA51

To claim this, I am signing this object:

@kouphax
kouphax / calendars.clj
Created March 7, 2014 15:47
A few clojure functions for generating data representations of calendars
(ns calendars.core
(require [clj-time.core :as time]))
(declare in-same-month?)
(declare first-day-of-week)
(declare weekyears-between)
(defn week-calendar
"Given a starting date this function will return a LazySeq of the enclosing date
for the same month of the start-date. Week days that are not in the the same
@kouphax
kouphax / bundles
Last active August 29, 2015 13:56
some linuxy codez for JVM based development
#! /bin/bash
# lite weight vundle thing for vim bundles. requires pathogen
bundles=(
kien/ctrlp.vim
emezeske/paredit.vim
tpope/vim-classpath
tpope/vim-fireplace
cschlueter/vim-wombat
scrooloose/nerdtree
kien/rainbow_parentheses.vim