Skip to content

Instantly share code, notes, and snippets.

View robwhitaker's full-sized avatar

Robert Whitaker robwhitaker

View GitHub Profile
@robwhitaker
robwhitaker / .envrc
Created February 14, 2020 04:53
Simple direnv file for lorri
if has lorri; then
old_path="$PATH"
eval "$(lorri direnv)"
export PATH="$PATH:$old_path"
fi

Keybase proof

I hereby claim:

  • I am robwhitaker on github.
  • I am rhitakorrr (https://keybase.io/rhitakorrr) on keybase.
  • I have a public key ASBlF6QcOPFPrgthQNsDDvvoGgq58PhRjdSPRBQBgkFWMQo

To claim this, I am signing this object:

@robwhitaker
robwhitaker / cVimrc
Last active December 23, 2019 20:38
Config for cVim
set smoothscroll
set autohidecursor
set noautofocus
set sortlinkhints
set scalehints
set autoupdategist
let searchengine duckduckgo = ["https://duckduckgo.com", "https://duckduckgo.com/?q="]
let searchengine ecosia = ["https://www.ecosia.org", "https://www.ecosia.org/search?q="]
let searchengine startpage = ["https://www.startpage.com", "https://www.startpage.com/do/search?query="]
@robwhitaker
robwhitaker / TweegoSetup.md
Last active September 22, 2022 05:02
Setting up Tweego w/ SugarCube 2.20 & Sublime Text 2 / VSCode

Tweego Setup

Note:

  • 2020-02-24 - Several things have changed since I wrote this back in 2017. I suggest checking out AnotherEpigone's comment below before trying to follow this guide.

Downloading and installing Tweego

You can download Tweego from the (hard to find) Tweego page on the Motoslave website. Compiled executables are available for Windows, Mac, and Linux, or you can follow the link on that page to Bitbucket to compile it yourself from source (instructions on Bitbucket).

There is no installer. Once you download the executable, add it to your PATH and you're all set to use Tweego...

function mindPsAndQs(input) {
return input.match(/[PQ]+/g).reduce(function(acc, str) {
return Math.max(acc, str.length);
}, 0);
}
function hasDuplicates(arr) {
var exists = {};
for(var i = 0; i < arr.length; i++)
if(exists[arr[i]])
return true;
else
exists[arr[i]] = true;
return false;
}
// Write a function `hipsterfy(sentence)` that takes takes a string containing
// several words as input. Remove the last vowel from each word. `'y'` is not a vowel.
function isVowel(char) {
return ["a","e","i","o","u"].indexOf(char.toLowerCase()) !== -1;
}
function hipsterfy(str) {
return str.split("").reverse().reduce(function(acc, char) {
if(isVowel(char) && acc.needLastVowel)
import Graphics.Element exposing (..)
import Window
import Graphics.Input exposing (..)
main : Signal Element
main = Signal.map content Window.dimensions
divI a b = round (toFloat a / b)
content : (Int, Int) -> Element
@robwhitaker
robwhitaker / MMPHalloween2015Testing.md
Last active October 27, 2015 22:55
MMP Halloween 2015 Testing

Requirements

  • Elm v0.15.1

Instructions

  1. Fork this repository: https://github.com/robwhitaker/MMPHalloween2015

  2. cd into the forked folder and run elm package install

  3. Once the packages are installed, run elm reactor

@robwhitaker
robwhitaker / ReadyListener.js
Created August 11, 2015 23:09
Just a simple utility class for some callback handling.
function ReadyListener(config) {
this.properties = config || {};
this.onReady = function() {};
}
ReadyListener.prototype.ready = function(key) {
this.properties[key] === false && (this.properties[key] = true);
var isReady = true;
for(k in this.properties) isReady = isReady && this.properties[k];
isReady && this.onReady();