Skip to content

Instantly share code, notes, and snippets.

James Cash jamesnvc

Block or report user

Report or block jamesnvc

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
jamesnvc / classes.js
Last active Apr 12, 2019
LHL W6D5 - 2019-04-12
View classes.js
class ShoppingCart {
constructor(name) { = name;
this.items = [];
addItem(item) {
jamesnvc / 1password2pass.rb
Last active Mar 9, 2018
Enhancement of the default script to also include OTP keys
View 1password2pass.rb
#!/usr/bin/env ruby
# Copyright (C) 2014 Tobias V. Langhoff <>. All Rights Reserved.
# This file is licensed under GPLv2+. Please see COPYING for more information.
# 1Password Importer
# Reads files exported from 1Password and imports them into pass. Supports comma
# and tab delimited text files, as well as logins (but not other items) stored
# in the 1Password Interchange File (1PIF) format.
jamesnvc /
Created Jan 12, 2018
Linux Unicode input
#!/usr/bin/env python3
Emulate Gnome's Unicode input method.
Requires `pyxhook` and `xdotool` to be installed
`pip install pyxhook`
`sudo apt-get install xdotool`
jamesnvc /
Created Jan 27, 2017
Shell script template to only act on "clean" git repos
set -euo pipefail
set +e
if ! git diff-files --quiet --ignore-submodules ; then
echo "Uncommited changes; stash or commit before deploying"
exit 1
if ! git diff-index --cached --quiet HEAD --ignore-submodules ; then
jamesnvc / perlin.cljc
Last active Nov 29, 2016
Perlin noise in Clojure(Script) (based on eevee's implementation)
View perlin.cljc
(ns spacebaluch.perlin)
; Based on eevee's implementation
; and blog post
(def sqrt
#?(:cljs js/Math.sqrt
:clj #(Math/sqrt %)))
View Dvorak-LCD.kbd.json
"backcolor": "#ffffff",
"name": "Dvorak LCD",
"author": "Bart Nagel",
"background": {
"name": "Maple orange",
"style": "background-image: url('/bg/wood/maple-orange.jpg');"
"switchMount": "alps",
View ViewController.swift
// ViewController.swift
// AnimDemo
// Created by James Cash on 17-02-16.
// Copyright © 2016 Occasionally Cogent. All rights reserved.
import UIKit
View slade.cfg
* SLADE Configuration File
* Don't edit this unless you know what you're doing
archive_load_data 0
elist_colname_width 80
elist_colsize_width 64
View precompile.clj
(ns blog.precompile
(:require [me.raynes.fs :as fs]
[cljs.closure :as cljsc]
[ :as io])
(:import [javax.script ScriptEngineManager ScriptException]))
(defn eval-js
(let [engine (.getEngineByName (ScriptEngineManager. ) "nashorn")]
(.eval engine js)))
View tic_tac_toe.cljs
(let [won-subboard (fn [board]
(let [all-equal (fn [v] (and (apply = v) (first v)))]
; horizontal lines
(all-equal (subvec board 0 3))
(all-equal (subvec board 3 6))
(all-equal (subvec board 6 9))
; vertical lines
(all-equal (vals (select-keys board [0 3 6])))
(all-equal (vals (select-keys board [1 4 7])))
You can’t perform that action at this time.