Skip to content

Instantly share code, notes, and snippets.

Zach Walton zachwalton

Block or report user

Report or block zachwalton

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 gist:c8fea204edc3033d200e032eae11b9b4
openapi: "3.0.0"
info:
version: 0.1.0
title: Johnny Cache
license:
name: MIT
paths:
/records:
post:
summary: Create a cache record
@zachwalton
zachwalton / has_one_through_bug.rb
Created Feb 12, 2018
has_one through not available on unpersisted instances
View has_one_through_bug.rb
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
@zachwalton
zachwalton / association_bug_reproduction.rb
Created Oct 5, 2017
has_and_belongs_to_many association bug
View association_bug_reproduction.rb
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", "5.1.3"
@zachwalton
zachwalton / remote_sync.sh
Last active Sep 25, 2017
rsync files when an fswatch event is detected
View remote_sync.sh
#!/bin/bash
function tracked_by_git() {
cd $(dirname $1)
git ls-files --error-unmatch $1 &>/dev/null
ret=$?
cd - &>/dev/null
return $ret
}
@zachwalton
zachwalton / rpi.js
Created Aug 7, 2017
interacting with raspberry pi gpio via react-hardware
View rpi.js
/**
* Pulsing LED example.
* Insert an LED into Pin 9 and run this example.
*/
import Raspi from 'raspi-io';
import React, {Component} from 'react';
import ReactHardware from '../../src';
import five from 'johnny-five';
View keybase.md

Keybase proof

I hereby claim:

  • I am zachwalton on github.
  • I am zachwalton (https://keybase.io/zachwalton) on keybase.
  • I have a public key ASDSRXIphhDdORuYOPDX_p53YEa4nFWY0mhNzo3sGGFNRgo

To claim this, I am signing this object:

View activerecord_bug_report_template.rb
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", "4.2.7.1"
@zachwalton
zachwalton / git-prompt.sh
Created Jul 17, 2016
git-prompt.sh, emoji version
View git-prompt.sh
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
View GOOOOOOOOAL
zach (python):
import inspect
def g(v=None):
f=str(inspect.currentframe().f_back)
if not v:
g.__dict__[f] = g.__dict__[f] + 'O' if g.__dict__.get(f) else 'GO'
return g
print g.__dict__.pop(f, 'G') + 'AL'
@zachwalton
zachwalton / gist:699391cd1cdc5bac76bc
Created Feb 4, 2016
convert dropbox urls to raw
View gist:699391cd1cdc5bac76bc
use strict;
use vars qw($VERSION %IRSSI);
$VERSION = '0.0.1';
%IRSSI = (
authors => '',
contact => '',
name => 'fix_dropbox',
description => 'unfuck dropbox urls',
license => '',
You can’t perform that action at this time.