Skip to content

Instantly share code, notes, and snippets.

View lizell's full-sized avatar

Christian Lizell lizell

View GitHub Profile
@lizell
lizell / ffmpeg-app-preview.sh
Created January 21, 2022 14:09
App Store app preview ffmpeg
# ffmpeg-app-preview.sh input.mp4 output.mp4
# Keeps aspect ratio and pads with black
ffmpeg -i $1 -vf "scale=w=1600:h=1200:force_original_aspect_ratio=1,pad=1600:1200:(ow-iw)/2:(oh-ih)/2,setsar=1" $2
@lizell
lizell / keybase.md
Created September 18, 2017 11:14
keybase.md

Keybase proof

I hereby claim:

  • I am lizell on github.
  • I am lizell (https://keybase.io/lizell) on keybase.
  • I have a public key whose fingerprint is 12C8 C387 AB6F 9BD5 DD19 F656 99D3 AA01 48A8 4836

To claim this, I am signing this object:

@lizell
lizell / gist:5883886
Last active December 19, 2015 02:29
Emergency stop and land for the AR Drone 2.0 using node.js
process.on('SIGINT', function() {
console.log('Got SIGINT. Stopping and landing.');
if (simulation) {
process.exit();
} else {
client.stop();
client.land(function() { process.exit(); });
}
});
@lizell
lizell / cpdup.sh
Last active December 15, 2015 03:29
Small function that can be put in your .bashrc that checks the given paths for jars that exists in both paths. Helpful for e.g. finding jars that exists in both shared lib and webapp lib.
## Checks the given paths for jars that exists in both paths. Helpful
## for e.g. finding jars that exists in both shared lib and webapp lib.
cpdup() {
if [ "$2" = "" ]; then
echo "Usage: cpdup .../WEB-INF/lib .../shared/lib"
else
for JAR in $1/*.jar
do
JAR_FILE=`basename $JAR`
JAR_NAME=${JAR_FILE%-*}
@lizell
lizell / globalProxy.java
Last active March 2, 2020 19:51
How to set a global proxy in Java when you can not control how your third party code communicates. Put this static block somewhere in a class that is loaded by your application.
static {
ProxySelector.setDefault(new ProxySelector() {
private final ProxySelector def = ProxySelector.getDefault();
@Override
public List<Proxy> select(final URI uri) {
if ("http".equalsIgnoreCase(uri.getScheme()) || "socket".equalsIgnoreCase(uri.getScheme())) {
if (uri.getHost().contains("<changeme>")) {
// Using proxy for <changeme> call
return Arrays.asList(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("192.168.111.1", 8889)));