Skip to content

Instantly share code, notes, and snippets.

@liyanage
liyanage / gist:6f6379d1f7bffb2bbe1c
Created October 17, 2014 06:21
MicroPython firmware update via DFU on OS X

brew install dfu-util

Download new firmware from http://micropython.org/download/

Connect pins DFU and 3.3v, press reset button

dfu-util -l should list entries with "Found DFU: "

dfu-util --alt 0 --device 0483:df11 -D ~/Desktop/pybv10-2014-10-17-v1.3.3-86-g37ada23.dfu

#!/usr/bin/perl -w
use strict;
use IO::File;
my $xsltproc = "/usr/bin/xsltproc";
my $data = do {undef local($/); <>};
my $xslt = do {undef local($/); <DATA>};
my $tempfile = "/tmp/xml-prettyprint.$$";
# An RPM spec file to build the Phusion Passenger Apache 2 module
# as a binary RPM for CentOS 5 / Red Hat Enterprise Linux 5.
#
# Written by Marc Liyanage for futureLAB AG
#
%define gem_name passenger
%define gem_description Phusion Passenger is a deployment system for Ruby on Rails applications on Apache, i.e. a 'mod_rails'
Summary: rubygem-%{gem_name} - %{gem_description}
Name: rubygem-%{gem_name}
Sampling process 16458 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling MondoMouseTool (pid 16458) every 1 millisecond
Call graph:
2564 Thread_455118 DispatchQueue_1: com.apple.main-thread (serial)
2564 0x2619
2564 0x26f2
2564 NSApplicationMain
2564 -[NSApplication run]
2564 0x163ab
Sampling process 1529 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Versions (pid 1529) every 1 millisecond
Call graph:
2474 Thread_20945 DispatchQueue_1: com.apple.main-thread (serial)
2474 0x24f0
2474 0x25c1
2474 NSApplicationMain
2474 -[NSApplication run]
2474 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
echo "show State:/Network/BackToMyMac" | scutil
// LDFLAGS='-framework Foundation' make archivertest
#import <Foundation/Foundation.h>
typedef enum Foo {
Foo1 = 0UL,
Foo2 = 1,
Foo3 = 2
} FooType;
// LDFLAGS='-framework Foundation' make test2 && ./test2
#import <Foundation/Foundation.h>
@interface Foo : NSObject {
NSString *bar;
}
@property (retain) NSString *bar;
// CFLAGS='-arch i386' make blockstest && ./blockstest
#include <stdio.h>
#include <Block.h>
int main() {
int(^foo)() = ^() {
return 1+1;