Skip to content

Instantly share code, notes, and snippets.

@tluyben
tluyben / csv2deviceids.pl
Created June 13, 2013 10:38
Convert a CSV to Apple iOS import plist format. The format in the samples from Apple is not complete and thus does not work. This one does (at least it does now).
#!/usr/bin/perl
$file = $ARGV[0];
$skip = $ARGV[1];
$prefix = $ARGV[2];
if (!$file or not -f $file) {
print "Usage: ./csv2deviceids.pl filename.csv [skip first n lines] [prefix]\n";
exit;
}
class Bla {
class A {
A() {
c();
}
void c() {
System.out.println("in A.c");
}
@tluyben
tluyben / lddcollect
Created December 2, 2013 11:47
Lddcollect is a small tool which packs up and installs binaries, libraries and related files no a linux (possibly unix) machine.
#!/usr/bin/perl
use strict;
use warnings;
my $cmd = $ARGV[0];
if (scalar(@ARGV) < 2 or ($cmd ne "c" and $cmd ne "i" and $cmd ne "r")) {
print "Usage: lddcollect [cir] [binary/tgz/dir] [extra]\n\n";
print "Lddcollect is a small tool which packs up and installs binaries, libraries and related files.\n";
@tluyben
tluyben / gist:8435052
Created January 15, 2014 12:05
EU memberstates
eu = ["at", "be", "bg", "cy", "cz", "de", "dk", "ee", "es", "fi", "fr", "gr", "hu", "ie", "cr", "it", "lt", "lu", "mc", "lv", "mt", "nl", "pl", "pt", "ro", "se", "si", "sk", "uk", "gb"]
@tluyben
tluyben / gist:8647131
Created January 27, 2014 11:42
Xamarin Slide up from bottom modal view transition for iOS 7
public class TransitioningDelegate : UIViewControllerTransitioningDelegate
{
public override IUIViewControllerAnimatedTransitioning PresentingController (UIViewController presented, UIViewController presenting, UIViewController source)
{
return new ModalSlideUpAnimator ();
}
public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForDismissedController (UIViewController dismissed)
{
@tluyben
tluyben / gist:f8b19965eaab6d236f9b
Created May 1, 2014 10:29
Atari 2600 ET sourcecode 1982
LIST OFF
; *** E . T. T H E E X T R A - T E R R E S T R I A L ***
; Copyright 1982 Atari, Inc.
; Designer: Howard Scott Warshaw
; Artist: Jerome Domurat
; Analyzed, labeled and commented
; by Dennis Debro
; Last Update: July 18, 2006
;
@tluyben
tluyben / gist:867c4af4275a79d97683
Created June 27, 2014 08:00
C# filename/line number logging
public static void Log(string message, params object[] ps)
{
message = string.Format (message, ps);
var StackTrace = new System.Diagnostics.StackTrace(true);
var StackFrame = StackTrace.GetFrame(1);
string FileName = StackFrame.GetFileName();
string LineNumber = StackFrame.GetFileLineNumber().ToString();
Console.WriteLine("{0} ({1}): {2}", FileName, LineNumber, message);
public class LastReturned {
Dictionary<Thread, object> Returned = new Dictionary<Thread, object>();
public object Ret(object o) {
if (o != null) {
if (Returned.ContainsKey (Thread.CurrentThread)) {
Returned [Thread.CurrentThread] = o;
@tluyben
tluyben / gist:76ae8c74736fa47b33a4
Created August 1, 2014 11:49
Get crash reports with symbols for iOS
#!/usr/bin/python
import sys
import os.path
import re
import subprocess
if len(sys.argv) < 4:
print "Usuage: ./getcrash.py AppName AppSymbol crashlog.ips"
print "Where AppName is the iOS app name without .app, AppSymbol the app name in the logs (usually almost the same as the AppName and the crash log file."
Undefined symbols for architecture x86_64:
"wxTreeListCtrl::DeleteItem(wxTreeListItem)", referenced from:
gd::ChooseVariableDialog::OnvariablesListKeyDown1(wxKeyEvent&) in ChooseVariableDialog.cpp.o
gd::ChooseVariableDialog::OnRemoveSelected(wxCommandEvent&) in ChooseVariableDialog.cpp.o
gd::ChooseVariableDialog::RefreshVariable(wxTreeListItem, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, gd::Variable const&) in ChooseVariableDialog.cpp.o
"wxTreeListCtrl::SetItemData(wxTreeListItem, wxClientData*)", referenced from:
gd::SpriteObjectEditor::RefreshCollisionMasks() in SpriteObjectEditor.cpp.o
"wxTreeListCtrl::SetItemText(wxTreeListItem, unsigned int, wxString const&)", referenced from:
gd::SpriteObjectEditor::RefreshCollisionMasks() in SpriteObjectEditor.cpp.o
gd::ChooseVariableDialog::RefreshVariable(wxTreeListItem, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, gd::Variable