Skip to content

Instantly share code, notes, and snippets.

View phaus's full-sized avatar
🦓

Philipp Haussleiter phaus

🦓
View GitHub Profile
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@zaus
zaus / WpPluginUpgradeBase.php
Last active October 2, 2020 17:10
Wordpress Activation/Upgrade Hook Helper
<?php
if(!class_exists('WpPluginUpgradeBase')) :
abstract class WpPluginUpgradeBase {
function __construct() {
add_action( 'admin_init', array(&$this, 'load_plugin') );
}
@renatoathaydes
renatoathaydes / JavaFX in OSGi
Last active March 9, 2020 09:48
Packages needed by JavaFX 2.2 to work in OSGi
# Added the following extra packages to OSGI to enable JavaFX 2.2 (JRE 7 update 13)
# Extra packages appended after standard packages
org.osgi.framework.system.packages.extra=javafx.application;version=0.0.0, \
com.sun.browser.plugin; version=0.0.0, \
com.sun.deploy.uitoolkit.impl.fx; version=0.0.0, \
com.sun.deploy.uitoolkit.impl.fx.ui; version=0.0.0, \
com.sun.deploy.uitoolkit.impl.fx.ui.resources; version=0.0.0, \
com.sun.deploy.uitoolkit.impl.fx.ui.resources.image; version=0.0.0, \
@bdha
bdha / vbox_to_kvm.txt
Created March 1, 2012 04:04
Migrating from VirtualBox to KVM on ZFS
# It's important to convert the vbox image (VMDK or VDI or whatever) using
# the same version of VirtualBox that created it. You can try converting the image
# with qemu-img or kvm-img, but weird version mismatches will possibly make it not
# work.
# On your VirtualBox machine:
cd $VBOX_ROOT/$MACHINE_ROOT/
VBoxManage clonehd machine.vmdk machine.img --format RAW
scp machine.img root@kvm-host:/somewhere
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phaus
phaus / checkGC.sh
Last active September 27, 2016 12:02
check for OBJC_IMAGE_SUPPORTS_GC macOS Sierra compatibility
#!/bin/bash
checkFile(){
FILE=$1
OTOOL=`which otool`
TAIL=`which tail`
IFS='/' read -ra ADDR <<< "$FILE"
unset APP
for i in "${ADDR[@]}"; do
if [[ ! "${i-}" = $'\n' ]]; then
@FND
FND / logbot.js
Created August 9, 2013 11:07
simplistic XMPP logging bot
/*jslint vars: true, node: true, white: true */
"use strict";
var xmpp = require("node-xmpp");
// XXX: hard-coded
var ROOM = "innoq@conference.jabber.innoq.com";
var NICK = "bot";
@cyrusbeer
cyrusbeer / Avatar.java (Model)
Created January 26, 2012 18:25
Upload, Crop, and Resize an Image with the Play! Framework and jQuery
package models;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;