Skip to content

Instantly share code, notes, and snippets.

View praseodym's full-sized avatar
:shipit:
ship it

Mark Janssen praseodym

:shipit:
ship it
View GitHub Profile
@praseodym
praseodym / quickAndDirtyNewsArticle
Created November 2, 2011 15:37 — forked from SpacyRicochet/quickAndDirtyNewsArticle.html
Quick and dirty html template for news articles in iPad app.
<!DOCTYPE html>
<style type="text/css">
p.clear {
clear:both;
}
</style>
<div style="float: left;">
<img class="newsPhoto" src="http://www.iphoneplatform.nl/upload/1238413896apple-logo-black-xsan.jpg" width="250" height="100">
<br>
<img src="http://www.iphoneplatform.nl/upload/1238413896apple-logo-black-xsan.jpg" width="60" height="60">
import java.util.Calendar;
public class JavaDay {
public static void main(String[] args) {
Calendar date = Calendar.getInstance();
date.set(2012, 6, 28);
System.out.println(date.getTime() + " is Java Day, a day where everybody speaks in Java.");
System.out.println("Why? Just because we can.\n");
@praseodym
praseodym / collegerama.py
Created June 21, 2012 09:26
Collegerama rip to mp4
#!/usr/bin/env python
# By Mark Janssen,
# Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
from xml.dom import minidom
from math import ceil
from collections import deque
from subprocess import call
from tempfile import mkdtemp
@praseodym
praseodym / gist:5236933
Created March 25, 2013 12:59
SKP 2013 compiler flags
C (GCC 4.7.2):
gcc -g -Wall -O2 -std=gnu99 -static -pipe -o $DEST "$@" -lm
C++:
g++ -g -Wall -O2 -std=gnu++98 -static -pipe -o $DEST "$@"
C++11:
g++ -g -Wall -O2 -std=c++11 -static -pipe -o $DEST "$@"
Java 7:
Compileren: javac -encoding UTF-8 -d . "$@"
Runtime: java -Xrs -Xss8m -Xmx1721440k $MAINCLASS
@praseodym
praseodym / lastfm.py
Created May 31, 2013 11:10
Textual Last.fm 'Now playing' script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# a last.fm now playing script originally written by Brandon Sutton
# some modifications by lifning
# and more modifications by praseodym
import urllib2
import sys
@praseodym
praseodym / gist:6499835
Last active December 22, 2015 16:29
Homebrew qt 4.8.5 on OS X 10.9
This file has been truncated, but you can view the full file.
~ % brew install -v qt 2>&1
==> Downloading http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
Already downloaded: /Library/Caches/Homebrew/qt-4.8.5.tar.gz
tar xf /Library/Caches/Homebrew/qt-4.8.5.tar.gz
==> ./configure -prefix /usr/local/Cellar/qt/4.8.5 -system-zlib -confirm-license -opensource -nomake demos -nomake examples -cocoa -fast -release -no-3dnow -no-ssse3 -L/opt/X11/lib -I/opt/X11/include -platform unsupported/macx-clang -no-qt3support -nomake docs -arch x86_64
./configure -prefix /usr/local/Cellar/qt/4.8.5 -system-zlib -confirm-license -opensource -nomake demos -nomake examples -cocoa -fast -release -no-3dnow -no-ssse3 -L/opt/X11/lib -I/opt/X11/include -platform unsupported/macx-clang -no-qt3support -nomake docs -arch x86_64
This is the Qt for Mac OS X Open Source Edition.
@praseodym
praseodym / unsign-JavaApplicationStub
Created October 3, 2013 12:25
Unsigning JavaApplicationStub
# The application is signed using a broken signature:
codesign -vvvv YourKit_Java_Profiler_12.0.6.app
# YourKit_Java_Profiler_12.0.6.app: invalid Info.plist (plist or signature have been modified)
# In architecture: x86_64
# Get a clean copy of the JavaApplicationStub
cp /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub YourKit_Java_Profiler_12.0.6.app/Contents/MacOS/JavaApplicationStub
# Unsign it using the script from http://snipt.org/kto/ (linked from http://lists.apple.com/archives/java-dev/2012/Jul/msg00136.html)
unsign_snipt.rb YourKit_Java_Profiler_12.0.6.app/Contents/MacOS/JavaApplicationStub
@praseodym
praseodym / tentamenticket.php
Created December 10, 2013 08:42
TU Delft tentamenticket generator
<?php
/**
* Clears header field to avoid injection
* http://www.anders.com/projects/sysadmin/formPostHijacking/
* http://www.davidseah.com/archives/2005/09/01/wp-contact-form-spam-attack/
*/
function preprocessHeaderField($value) {
//Remove line feeds
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
@praseodym
praseodym / csr.sh
Last active November 13, 2022 13:05
#!/bin/bash
# csr.sh: Certificate Signing Request Generator
set -e
if [ $# -lt 1 ]; then
echo "Usage: $0 hostname [alt.hostname1] [alt.hostname2]"
exit 1
fi