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
import org.joda.time.{Interval, Instant} | |
val intervals = List( | |
new Interval(new Instant("2014-01-25T12:00"), new Instant("2014-01-27T08:00")), | |
new Interval(new Instant("2014-01-27T18:00"), new Instant("2014-01-28T08:00")), | |
new Interval(new Instant("2014-01-28T18:00"), new Instant("2014-01-29T08:00")), | |
new Interval(new Instant("2014-01-29T18:00"), new Instant("2014-01-30T08:00")), | |
new Interval(new Instant("2014-01-30T18:00"), new Instant("2014-01-31T08:00")), | |
new Interval(new Instant("2014-01-31T18:00"), new Instant("2014-02-01T08:00")), | |
new Interval(new Instant("2014-02-01T12:00"), new Instant("2014-02-03T08:00")), |
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
package util | |
import java.security._ | |
import java.security.spec.X509EncodedKeySpec | |
import javax.crypto._ | |
import org.apache.commons.codec.binary.Base64 | |
object RSA { | |
def decodePublicKey(encodedKey: String): Option[PublicKey] = { | |
this.decodePublicKey( |
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
"Afghanestan", "Al Arabiyah as Suudiyah", "Al Bahrayn", "Al Imarat al Arabiyah al Muttahidah", "Al Jaza'ir", "Al Kuwayt", "Al Maghrib", "Al Urdun", "Al Yaman", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Aomen", "Aotearoa", "Argentina", "Aruba", "As-Sudan", "Australia", "Azarbaycan", "Aṣ-Ṣaḥrā’ al-Gharbīyah ", "Bahamas", "Bangladesh", "Barbados", "Belau", "Belgique/Belgie", "Belize", "Benin", "Bermuda", "Bharat", "Bhutan", "Bod ", "Bolivia", "Bosna i Hercegovina", "Botswana", "Brasil", "Bulgaria", "Burkina Faso", "Burundi", "Byelarus", "Cabo Verde", "Cameroon", "Canada", "Cayman Islands", "Ceska Republika", "Chile", "Choson", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comores", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Crna Gora", "Cuba", "Danmark", "Dawlat Qatar", "Deutschland", "Dhivehi Raajje", "Djibouti", "Dominica", "Dominicana, Republica", "Éire", "Ecuador", "Eesti Vabariik", "El Salvador", "Ellas or Ellada", "España", "Estados Unidos M |
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
#!/bin/bash | |
SLEEP=`echo "$1*3600" | bc` | |
echo "Alarm triggered in $1 hours" | |
sleep $SLEEP > /dev/null | |
echo "Starting playing" | |
mpc volume 50 > /dev/null | |
mpc play > /dev/null | |
mpcfade.sh 50 65 0 | |
mpcfade.sh 65 75 1 | |
echo "Turning on TV and switching input to me" |
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
#!/bin/sh | |
tmux send -t alarm alarm SPACE $1 ENTER | |
echo "{ \"version\": 1, \"title\": \"Alarm\", \"type\": \"status\", \"status\": \"ok\", \"message\": \"Good night :)\"}" |
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
def blockingAndVerbose: Profile = { | |
val futureName = name() | |
val futureScore = score() | |
val futureFriends = friends() | |
val nameResult = Await.result(futureName, 10 seconds) | |
val scoreResult = Await.result(futureScore, 10 seconds) | |
val friendsResult = Await.result(futureFriends, 10 seconds) | |
Profile(nameResult, scoreResult, friendsResult) |
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
#!/bin/sh | |
# netstat.sh | |
# AddiKT1ve <the.addikt1ve@gmail.com> | |
# Mwyann <http://mwyann.info> | |
# Variables | |
ETHIFACE=eth0 | |
WLANIFACE=wlan0 | |
TMPDIR=. |
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
#!/bin/bash | |
#RAM | |
RAM=$(free -m | grep Mem: | awk '{print $3}') | |
let "ram = $RAM" | |
RAMBUFFER=$(free -m | grep Mem: | awk '{print $6}') | |
let "rambuffer = $RAMBUFFER" | |
RAMCACHE=$(free -m | grep Mem: | awk '{print $7}') | |
let "ramcache = $RAMCACHE" | |
let "ramused = ram-(rambuffer+ramcache)" |
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
package code { | |
package snippet { | |
import net.liftweb.common._ | |
import net.liftweb.util._ | |
import net.liftweb.http._ | |
import model._ | |
object Preferences extends LiftScreen { |
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
package code { | |
package snippet { | |
import net.liftweb.common._ | |
import net.liftweb.util._ | |
import net.liftweb.http._ | |
import net.liftweb.http.SHtml._ | |
import model._ | |
import model.UserType._ |