Skip to content

Instantly share code, notes, and snippets.


Jonathan Meaney jonathanmeaney

View GitHub Profile
jonathanmeaney / calc-mate.conf
Created Jan 16, 2021
calc-mate Nginx server config
View calc-mate.conf
server {
root /path/to/calc-mate/build;
index index.html;
location / {
try_files $uri /index.html;
jonathanmeaney / sketch.js
Last active Aug 8, 2020
Seven segment display clock
View sketch.js
let digitHour0, digitHour1, digitMinute0, digitMinute1, digitSecond0, digitSecond1;
let colon1, colon2;
function setup() {
createCanvas(395, 110);
function draw() {
jonathanmeaney / generate_lock_version_migrations.rb
Last active Jul 27, 2020
Iterate a list of table names and generate a migration file to add the lock_version column to each
View generate_lock_version_migrations.rb
[].each do |table|
time ="%Y%m%d%H%M%S")
filename = "#{time}_add_lock_version_to_#{table}.rb", 'w') do |file|
file.puts("class AddLockVersionTo#{table.camelize} < ActiveRecord::Migration[5.2]")
file.puts(" def change")
file.puts(" add_column :#{table}, :lock_version, :integer, default: 0")
file.puts(" end")
jonathanmeaney / Google Books Search.js
Created Dec 9, 2011
Using google books rest api to search for books
View Google Books Search.js
function view_books()
$.getJSON('', function(data) {
var items = [];
$.each(data, function(key, val) {
items.push('<li id="' + key + '">' + val + '</li>');