Skip to content

Instantly share code, notes, and snippets.

View Pyppe's full-sized avatar

Pyry-Samuli Lahti Pyppe

View GitHub Profile
@Pyppe
Pyppe / AndroidManifest.xml
Created October 23, 2012 11:13
FutuScreen
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.futurice.futuscreen"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/ic_launcher"
implicit class PyppeContext(ctx: StringContext) {
def zot(args: Any*) = XML.loadString(ctx.standardInterpolator(StringContext.treatEscapes, args))
}
dpkg -l|egrep '^ii linux-(im|he)'|awk '{print $2}'
uname -r
# http://ubuntugenius.wordpress.com/2011/01/08/ubuntu-cleanup-how-to-remove-all-unused-linux-kernel-headers-images-and-modules/
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
And then apt-get purge
package foobar
import scala.slick.lifted.{BaseTypeMapper, TypeMapperDelegate}
import scala.slick.driver.BasicProfile
import scala.slick.session.{Session, PositionedParameters, PositionedResult}
import language.implicitConversions
abstract class ArrayTypeMapper[T: scala.reflect.ClassTag] extends BaseTypeMapper[Array[T]] with TypeMapperDelegate[Array[T]] {
def apply(p: BasicProfile) = this
#!/bin/bash
# http://even.li/imagemagick-sharp-web-sized-photographs/
ls *.jpg|while read i;do gm convert $i -resize "900x" -unsharp 2x0.5+0.5+0 -quality 98 `basename $i .jpg`_s.jpg;done
@Pyppe
Pyppe / set-cpu-ondemand-upscaling.sh
Created July 18, 2013 11:50
My Lenovo Carbon X1 does not up-scale CPUs correctly with Ubuntu 13.04 using the ondemand governing. Lowering the up-threshold seems to do the trick.
#!/bin/bash
# default with 13.04 is 95
SCALING_FILE=/sys/devices/system/cpu/cpufreq/ondemand/up_threshold
if [ ! -f "$SCALING_FILE" ]; then
echo "$SCALING_FILE not found"
exit 1
fi
@Pyppe
Pyppe / Application.scala
Last active December 20, 2015 06:09
Play framework logging setup, for getting proper class names into log files.
package controllers
import play.api._
import play.api.mvc._
object Application extends Controller with LoggerSupport {
def index = Action { implicit req =>
logger.info(s"Serving index to ${req.remoteAddress}")
Ok(views.html.index())
}
sudo apt-get install xvfb
# as CI user
export DISPLAY=":99"
Xvfb :99 -ac
#!/bin/bash
# - LightTable 0.5.4 does not run with the provided LightTable script on Linux 64bit
# - @see https://github.com/Kodowa/Light-Table-Playground/issues/810
# - This script links the existing libudev.so.1 as libudev.so.0 *within installation dir*
# - Tested with Ubuntu 13.04 64bit
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
LOCAL_LIB=$DIR/libudev.so.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.