Skip to content

Instantly share code, notes, and snippets.

View grekko's full-sized avatar
🙃
wAt

Gregory Igelmund grekko

🙃
wAt
View GitHub Profile
@grekko
grekko / htw-doodle-slots.js
Last active November 16, 2015 08:27
HTW: Doodle prefill Dates configurable time slots
window.__startDate = function(startHours, startMinutes) {
dateStr = $('.timesTable .first').data('date-string').toString();
date = new Date(dateStr.substr(0, 4), dateStr.substr(4, 2), dateStr.substr(6, 2));
date.setHours(startHours);
date.setMinutes(startMinutes);
return date;
};
window.__dateIncMinutes = function(date, minutes) {
var ms = date.getTime();
@grekko
grekko / rbenv-install-with-patches.rb
Created August 25, 2015 15:19
Install (via rbenv) rubies with patches (e.g. for memory profiling)
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
PATCH_REPO_BASE_URL = 'https://raw.githubusercontent.com/skaes/rvm-patchsets/master'
PATCH_SET = ARGV[0]
PATCH_RUBY_VERSION = ARGV[1]
raise 'Please specify a patchset (e.g. railsexpress). `ruby-install-with-patches railsexpress 2.2.3`' if PATCH_SET.nil?
@grekko
grekko / game-of-life.js
Created April 24, 2015 14:12
One-Dimensional Game of Life in one sane line of ES6 JS
describe('Game of life', function() {
it('should evolve exist', function() {
assert.equal(typeof e, 'function');
});
it('should evolve return same length list', function() {
var board = [0, 0, 0, 0, 0];
assert.equal(e(board).length, board.length);
@grekko
grekko / keybase.md
Last active August 29, 2015 14:12
My keybase authentication

Keybase proof

I hereby claim:

  • I am grekko on github.
  • I am grekko (https://keybase.io/grekko) on keybase.
  • I have a public key whose fingerprint is 7751 4AFC C6CF 9CB1 F471 ED8C B7A0 8E77 273A F8E0

To claim this, I am signing this object:

@grekko
grekko / rspec-helpers-require_lib.gemspec
Last active August 29, 2015 14:12
RequireLib Helper for Rspec
Gem::Specification.new do |s|
s.name = 'rspec-helpers-require_lib'
s.version = '0.0.1'
s.platform = Gem::Platform::RUBY
s.author = 'Gregory Igelmund'
s.email = 'me@grekko.de'
s.summary = 'requiring libs made easy'
s.description = 'requiring libs made eady'
s.files = ['rspec-helpers-require_lib.rb']
@grekko
grekko / raspberry-install.sh
Created December 4, 2014 11:41
Raspberry Install script
#!/bin/sh
# Source: https://www.danpurdy.co.uk/web-development/raspberry-pi-kiosk-screen-tutorial/
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install chromium x11-xserver-utils unclutter
# After the installation, do:
# 1) Disable screensaver
# sudo nano /etc/xdg/lxsession/LXDE/autostart
# 2) Disable by commenting out: "@xscreensaver -no-splash"
# Add the following:
@grekko
grekko / .envrc.sample
Last active August 29, 2015 14:07
Ruby Tapas Episode fetcher
export TAPAS_HTTP_COOKIE=
export HTTP_AUTH=
@grekko
grekko / play-bar.yml
Last active August 29, 2015 14:07
Ansible playbook w/ multiple play includes
---
- hosts: all
remote_user: root
tasks:
- name: Say bar
shell: echo "bar"
@grekko
grekko / null.gemspec
Last active August 29, 2015 14:05
Null Object for Ruby
Gem::Specification.new do |s|
s.name = 'null'
s.version = '0.0.1'
s.platform = Gem::Platform::RUBY
s.author = 'Gregory Igelmund'
s.email = 'me@grekko.de'
s.summary = 'Dynamic Null Object'
s.description = 'Responds on all methods with itself. Credits to @flori. NullObject is taken from Tins: https://github.com/flori/tins'
s.files = ['null.rb']
# Task: Implement the rcat utility and get these tests to pass on a system
# which has the UNIX cat command present
# To see Gregory Brown's solution, see http://github.com/elm-city-craftworks/rcat
# Feel free to publicly share your own solutions
rrequire "open3"
working_dir = File.dirname(__FILE__)
gettysburg_file = "#{working_dir}/data/gettysburg.txt"