Skip to content

Instantly share code, notes, and snippets.

View tifletcher's full-sized avatar

Themba Fletcher tifletcher

  • CrunchBase
  • San Francisco, CA
View GitHub Profile
@tifletcher
tifletcher / projections.sc
Created November 9, 2017 06:42
Arbitrary type projections as extension methods callable on the <From> type parameterized by the desired <To> type
import java.util.UUID
// given this machinery
trait Translator[-I, +O] {
def translate(i: I): O
}
object TypeProjector {
implicit class Translatable[T](i: T) {
def project[U](implicit translator: Translator[T, U]): U = translator.translate(i)
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@aruld
aruld / Info.plist
Last active March 29, 2016 14:07
To run Intellij 14.1 with latest JDK 9 on OS X Yosemite, edit /Applications/IntelliJ\ IDEA\ 14.app/Contents/Info.plist and set JVMVersion to 1.8 under JVM Options.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
@tifletcher
tifletcher / euler.js
Created March 4, 2015 19:32
simple javascript generator without yield
// Project Euler problem 2
function makeFibSequence(a, b) {
// or ...
// var a = 0;
// var b = 1;
return function () {
var next = a + b;
a = b;
b = next;
return next;
@jamesward
jamesward / preso.md
Last active February 11, 2016 15:21
Modern Web Apps with Play Framework

Modern Web Apps with Play Framework

Create an app:

play new foo
cd foo

Add dependencies to project/Build.scala:

@sritchie
sritchie / plugins.sbt
Created April 20, 2013 00:37
The getting started with ensime post!
// Add this file to ~/.sbt/plugins/plugins.sbt.
//
// Once this is ready, make sure you have sbt 0.12 ("brew install sbt" should do it),
// then try running
//
// sbt "ensime generate"
//
// in bijection's root directory. ("git clone git@github.com:twitter/bijection.git")
resolvers += "Scala-Tools Maven2 Snapshots Repository" at "http://scala-tools.org/repo-snapshots"
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################