Skip to content

Instantly share code, notes, and snippets.

@pangratz
pangratz / LinzProviderTest.java
Created July 8, 2011 23:22
this is not the same id as shown in Oeffi on Android ...
public class LinzProviderTest extends TestCase {
private LinzProvider provider;
public void testAutocomplete() throws IOException {
List<Location> stations = provider.autocompleteStations("Schumpeter");
assertNotNull(stations);
assertEquals(1, stations.size());
Location schumpeter = stations.get(0);
@pangratz
pangratz / de_AT.json
Created August 29, 2011 21:04 — forked from cramforce/de.json
lang.json
// translation for austrian german, especially for the western, hillocky part (tyrol)
{
// maybe local de_AT_tyrol would fit better ...
"locale": "de_AT",
"text": {
"#authors": [
{
"name": "Malte Ubl",
"screen-name": "cramforce"
}
@pangratz
pangratz / de.json
Created August 29, 2011 21:18 — forked from cramforce/de.json
lang.json
{
"locale": "de",
"text": {
"#authors": [
{
"name": "Malte Ubl",
"screen-name": "cramforce"
}
],
"tweet": {
@pangratz
pangratz / app.js
Created May 28, 2012 19:16
Sample Ember.js app
App = Ember.Application.create();
@pangratz
pangratz / gist:3007220
Created June 27, 2012 22:17
Replace Undefined with string
//original ember version
Ember.getPath = function(root, path) {
var hasThis, isGlobal, ret;
// Helpers that operate with 'this' within an #each
if (path === '') {
return root;
}
if (!path && 'string'===typeof root) {
Dashboard.Router = Ember.Router.extend({
root: Ember.Route.extend({
index: Ember.Route.extend({
route: '/:username',
connectOutlets: function(router, context) {
router.set('userController.content', Dashboard.User.find(context.username));
},
index: Ember.Route.extend({
route: '/',
@pangratz
pangratz / gist:3197673
Created July 29, 2012 11:19
Usage of `controllers` property on a controller

A possible usage for the controllers property ...

App.AutoSuggestController = Ember.Controller.extend({
});
App.store = DS.Store.create({
revision: 4,
adapter: DS.RESTAdapter.create({
bulkCommit: false,
ajax: function(url, type, hash) {
this._super(url + '.json', type, hash);
}
})
});
@pangratz
pangratz / app.js
Created November 3, 2012 12:42
Ember.js showcase
App = Ember.Application.create();
App.ApplicationView = Ember.View.extend();
App.ApplicationController = Ember.Controller.extend();
App.Router = Ember.Router.extend({
root: Ember.Route.extend({
index: Ember.Route.extend()
})
});
@pangratz
pangratz / upload.js
Last active December 10, 2015 00:49 — forked from noiges/upload.js
$(function(){
$("#files").bind("change", handleFileSelection);
var dropzone = $("#dropzone");
dropzone.on("dragover",allowDrop);
dropzone.on("drop",drop);
});
function handleFileSelection(event){
upload(event.target.files);
}