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
My (not yet complete) solutions to exercises from 'Programming in Scala' book |
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
# url => link to poke | |
# name => human-readable name | |
# anchor => phrase to look for at page | |
define :poke_service do | |
def is_loaded? | |
Timeout::timeout(3) { | |
open params[:url].read.include? params[:anchor] | |
} | |
rescue WhateverExceptionsThereHappen | |
puts "#{params[:name]} is loading..."; sleep 10 and reload |
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
1. Format USB stick to FAT32: mkfs.fat -F 32 /dev/sdb1 | |
2. Use http://unetbootin.sourceforge.net/ to write Windows ISO to the USB drive | |
3. Copy chain32 to the flash drive's root directory: cp /usr/share/syslinux/chain.c32 /media/my_flash_drive | |
4. Paste the following into syslinux.cfg (located at drive's root): | |
default windows | |
prompt 0 | |
menu title UNetbootin | |
timeout 0 | |
LABEL windows |
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
#include <dht.h> | |
#include <LiquidCrystal_I2C.h> | |
#include <Wire.h> | |
LiquidCrystal_I2C lcd(0x27, 16, 2); | |
DHT dht11 = DHT(); | |
int HIH4030_Pin = A5; | |
void setup() { | |
lcd.init(); |
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
#include <LedControl.h> | |
// Display | |
int din = 8; | |
int clk = 10; | |
int cs = 9; | |
// Joystick click | |
int sw = 5; |
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
private def updateReturning[A, F]( | |
returningQuery: Query[A, F, C], v: U): SqlStreamingAction[Vector[F], F, Effect.All] = { | |
val ResultSetMapping( | |
_, CompiledStatement(_, sres: SQLBuilder.Result, _), CompiledMapping(_updateConverter, _)) = | |
updateCompiler.run(updateQuery.toNode).tree | |
val pconv: SetParameter[U] = { | |
val ResultSetMapping(_, compiled, CompiledMapping(_converter, _)) = | |
updateCompiler.run(updateQuery.toNode).tree | |
val converter = _converter.asInstanceOf[ResultConverter[JdbcResultConverterDomain, U]] |