[ Launch: Tributary inlet ] 8705650 by hanbzu
[ Launch: reftrips ] 8651099 by hanbzu
View this code at http://livecoding.io/8646864
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Ubuntu USB startup creator often crashes. | |
# This is an alternate way of doing the same process through the command line | |
# First plug in the USB pendrive. It will mount automatically | |
# Then check where it is (which device) | |
df | |
# Let's say we see it's in /dev/sdb1 | |
# Then we have to use /dev/sdb and NOT /dev/sdb1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# R Function to Draw Edward Tufte-style Slopeplots | |
slopegraph <- | |
function( | |
df, | |
xlim = c(.5,ncol(df)+.5), | |
ylim = c(min(df)-diff(range(df))/100,max(df)+diff(range(df))/100), | |
main = NULL, | |
bty = 'n', | |
yaxt = 'n', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here we add the 'userInput' method to the Future class | |
implicit class FutureCompanionOps(f: Future.type) extends AnyVal { | |
def userInput(message: String): Future[String] = Future { | |
readLine(message) | |
} | |
} | |
// Without the sintactic sugar: | |
class FutureCompanionOps(f: Future.type) extends AnyVal { | |
def userInput(message: String): Future[String] = Future { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find out the window ID of the window I want to record | |
xwininfo -display :0 | |
# Copy the window ID (something similar to 0x4600007) | |
recordmydesktop --windowid 0x4600007 | |
# Now the inside of the window (AND the mouse pointer if it goes inside) will be recorded | |
# CTRL + C will stop the recording |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a short walk through adding more disk space | |
# in a VirtualBox machine. There's good detailed information here: | |
# http://trivialproof.blogspot.com.es/2011/01/resizing-virtualbox-virtual-hard-disk.html | |
# Change to where your VirtualBox VMs are. For a Linux distribution it could be: | |
cd ~/VirtualBox\ VMs/ | |
# Find the name of the virtual machine you want to resize | |
cd YOUR_VIRTUAL_MACHINE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val a = Stream(1) | |
//a: scala.collection.immutable.Stream[Int] = Stream(1, ?) | |
def b: Stream[Int] = Stream(b.head) | |
//b: Stream[Int] | |
a #::: b | |
//res0: scala.collection.immutable.Stream[Int] = Stream(1, ?) | |
a append b |