Skip to content

Instantly share code, notes, and snippets.

View gshutler's full-sized avatar
📅
👨‍💻

Garry Shutler gshutler

📅
👨‍💻
View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@gshutler
gshutler / update-rbenv-rubygems.sh
Created June 9, 2015 14:24
Update Rubygems for all rbenv rubies
#! /usr/bin/env bash
set -e
eval "$(rbenv init -)"
for version in `rbenv whence gem`; do
rbenv shell "$version"
echo "Updating rubygems for $version"
gem update --system --no-document --quiet
@gshutler
gshutler / Example.java
Last active August 29, 2015 14:09
Example of retrieving a day's events in Java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public final class Example {
public static void main(String[] args) throws IOException {
String url = "https://api.onediary.com/v1/events?from=2014-12-17&to=2014-12-18&tzid=Europe/Lisbon";
String token = "REPLACE_WITH_YOUR_TOKEN";
config.hatchet.configure do |hatchet|
require 'rbconfig'
hatchet.backtrace_filters Bundler.bundle_path.to_s => '[BUNDLER]',
Bundler.bin_path.to_s => '[BUNDLER]',
Rails.root.to_s => '[RAILS_ROOT]',
RbConfig::CONFIG['sitelibdir'] => '[SITELIBDIR]',
RbConfig::CONFIG['rubylibdir'] => '[RUBYLIBDIR]',
RbConfig::CONFIG['libdir'] => '[LIBDIR]',
RbConfig::CONFIG['sitedir'] => '[SITEDIR]'
config.appender(Hatchet::LoggerAppender.new) do |appender|
appender.device = Logger.new('log/application.log')
end
config.appender(Hatchet::LoggerAppender.new) do |appender|
appender.file = 'log/application.log'
# Could delegate to:
# self.logger = Logger.new('log/application.log')
end
@gshutler
gshutler / the_key.rb
Last active August 29, 2015 13:57
The key, the secret
let(:key) { "I've got the key" }
let(:secret) { "I've got the secret" }
let(:refresh_token) { "I've got the key to another way" }
let(:token) { "Ah ah ah ah ah ah, aha aha" }
let(:iv) { "Ah ah ah ah ah" }
@gshutler
gshutler / proposal.markdown
Last active December 30, 2015 16:49
I'm sorry Dave, I'm afraid I don't understand that

I'm sorry Dave, I'm afraid I don't understand that

What happens when you think of email as a primary interface?

At One Diary we have spent as much time and effort on email as an interface as our website. I'll explain why we made that choice and how you can create your own.

I'll cover all we've learnt, from the basics of how to do it, how to overcome common pitfalls, tips and tricks for refining the experience, and a short introduction to natural language processing.

@gshutler
gshutler / gh-build-notification.sh
Created August 4, 2013 14:25
Tagging a commit with build status on GitHub
#! /usr/bin/env bash
# Examples
#
# $ gh-build-notification.sh pending "Build in progress"
# $ gh-build-notification.sh failure "Build failed"
# $ gh-build-notification.sh success "Build succeeded"
commit=`git rev-parse HEAD`