Skip to content

Instantly share code, notes, and snippets.

View ddewaele's full-sized avatar

Davy De Waele ddewaele

View GitHub Profile
@ddewaele
ddewaele / gist:2244262
Created March 29, 2012 22:10
node sude make install
ubuntu@domU-12-31-39-09-25-44:~/src/node$ sudo make install
make -C out BUILDTYPE=Release
make[1]: Entering directory `/home/ubuntu/src/node/out'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ubuntu/src/node/out'
ln -fs out/Release/node node
out/Release/node tools/installer.js install
mkdir -p /usr/local/include/node/
cp -rf src/node.h /usr/local/include/node/
cp -rf src/node_buffer.h /usr/local/include/node/
@ddewaele
ddewaele / gist:2322065
Created April 6, 2012 18:56
CouchDB on OS X Lion using HomeBrew
Davys-MacBook-Air:Projects ddewaele$ cd Node
Davys-MacBook-Air:Node ddewaele$ ls l
ls: l: No such file or directory
Davys-MacBook-Air:Node ddewaele$ git clone https://github.com/mxcl/homebrew.git
Cloning into homebrew...
remote: Counting objects: 62583, done.
remote: Compressing objects: 100% (26452/26452), done.
remote: Total 62583 (delta 41221), reused 53680 (delta 35342)
Receiving objects: 100% (62583/62583), 9.34 MiB | 565 KiB/s, done.
Resolving deltas: 100% (41221/41221), done.
@ddewaele
ddewaele / gist:2479767
Last active May 24, 2016 05:56
Adding a title + subtitle to a navigation bar
CGRect headerTitleSubtitleFrame = CGRectMake(0, 0, 200, 44);
UIView* _headerTitleSubtitleView = [[[UILabel alloc] initWithFrame:headerTitleSubtitleFrame] autorelease];
_headerTitleSubtitleView.backgroundColor = [UIColor clearColor];
_headerTitleSubtitleView.autoresizesSubviews = YES;
CGRect titleFrame = CGRectMake(0, 2, 200, 24);
UILabel *titleView = [[[UILabel alloc] initWithFrame:titleFrame] autorelease];
titleView.backgroundColor = [UIColor clearColor];
titleView.font = [UIFont boldSystemFontOfSize:20];
titleView.textAlignment = UITextAlignmentCenter;
<beans >
<camel:routeContext id="complex-route-context">
<camel:route id="complex-route" streamCache="true">
<!-- our main flow uses this from endpoint to enter this route -->
<camel:from uri="direct:complex-route-in" />
@ddewaele
ddewaele / gist:5481604
Created April 29, 2013 13:34
EmberJS CRUD http://jsfiddle.net snippet
<script type="text/x-handlebars" data-template-name="index">
<h2>Index Content:</h2>
<ul>
{{#each item in content}}
<li>{{item.firstName}} <button {{action removeItem item}}>removeItem</button></li>
{{/each}}
</ul>
<button {{action addPerson}}>addPerson</button> | <button {{action reloadPage}}>reload</button> | <button {{action removeLastItem}}>removeLastItem</button>
</script>
public void addMarkerToMap(LatLng latLng) {
	Marker marker = googleMap.addMarker(new MarkerOptions().position(latLng)
			 .title("title")
			 .snippet("snippet"));
	markers.add(marker);

}

##Memory issues

Was caused by maven transitive dependencies getting pulled in. A foursquare API library bringing in the entire Google Appengine SDK. Logged an issue in the Foursqare-java-api issue tracker

[2013-08-19 15:31:47 - AndroidFoursquareGoogleApiJavaClient] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(javax.mail.Session$7) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a

compiler that did not target the modern .class file format. The recommended

##Without the compatibility library

##With the compatibility library

##.classpath file

Classpath file remains the same. Adding / removing the compatability library doesn't change that.

###Support Library v4 android-support-v4.jar 543 KB (556,198 bytes)

Copied In the libs folder of your project by ADT

###Google Play Services

https://gist.github.com/ddewaele/6277487

This project was in my workspace but the files were still in my sdk folder.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>android.support</groupId>
<artifactId>compatibility-v7-appcompat</artifactId>
<version>18</version>
<packaging>apklib</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<platform.version>4.3_r1</platform.version>