Skip to content

Instantly share code, notes, and snippets.

View phaus's full-sized avatar
🦓

Philipp Haussleiter phaus

🦓
View GitHub Profile
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
@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') );
}
@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";
@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, \
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@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
@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
#
@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;
@sawanoboly
sawanoboly / wp.sh
Created October 10, 2011 08:27
Wordpress setup script for Joyent Smartmachine.
## WordPress Setup script for Joyent SmartMachine 1.3.6
## How to use.
# wget https://raw.github.com/gist/1274859/8508adf89853cfd9899648d3a867bfb5b81e0fe8/wp.sh --no-check-certificate -O - | bash
# Open http://{server address}
# 1.install mysql-server and apache,mod_php.
# 2.Download wordpress from svn repository.
# 3.create wp_config.php