Skip to content

Instantly share code, notes, and snippets.

# Eclipse
.project
.classpath
.settings
.checkstyle
# IntelliJ IDEA
.idea
*.iml
*.ipr
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tutorials.android.lockscreenwidgettutorial"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="daichan4649.lockoverlay"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />
/**
* We need dummy cookie storage that wouldn't save any cookies
* or get any cookies
*/
public class WebkitCookietHandlerProxy extends CookieHandler {
@Override
public void put(URI uri, Map<String, List<String>> responseHeaders) throws IOException {
if (uri == null || responseHeaders == null) {
@lassic
lassic / btn_ok_v.xml
Created February 12, 2014 16:57
Android "V shape" ok button drawable trick
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="125" android:pivotY="28%">
<shape android:shape="rectangle">
<stroke android:width="2px" android:color="#888888"/>
</shape>
</rotate>
@lassic
lassic / gist:7986345
Created December 16, 2013 12:37
Overlay JPG (watermark) image over video in a semi-transparent way using command line tools on OSX (imagemagick, ffmpeg). (I wish the ffmpeg overlay filter would support an alpha parameter, figuring out how to use the blend filter to achieve this was a bit too much for newbie in ffmpeg world).
#!/bin/bash
infile=vid.mp4
outfile=out.mp4
wmfile=wm.jpg
wmfilepng=stwm.png
alpha="70%"
# convert (imagemagick) image to semi-transparent
convert "$wmfile" -alpha set -channel A -evaluate set "$alpha" "$wmfilepng"