Skip to content

Instantly share code, notes, and snippets.

// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@fiedl
fiedl / categorize_csv.rb
Created August 21, 2013 13:25
Ruby script to **split a csv file** into separate files categorized by a category column.
#!/usr/bin/env ruby
#
# categorize_csv.rb
# Fiedlschuster, 2013-08-21
#
# Usage: ruby categorize_csv.rb --column 2 data.csv
# This splits the data.csv file into separate files,
# one for each category found in column 2 (numbered 1,2,3,...),
# and outputs to data.category_name.csv
#
@fiedl
fiedl / gmaps_turbolinks.js.coffee
Created September 15, 2013 18:26
"Hack" that dynamically loads the [gmaps4rails google api](https://github.com/apneadiving/Google-Maps-for-Rails) when using [turbolinks](https://github.com/rails/turbolinks/).
@fiedl
fiedl / Gemfile
Created September 17, 2013 21:00
gmaps4rails with turbolinks
# ...
gem 'turbolinks'
gem 'gmaps4rails', '~> 2.0.1', git: 'https://github.com/fiedl/Google-Maps-for-Rails'
# then run 'bundle install' and restart the rails server.
@fiedl
fiedl / svn-for-git-users.md
Last active December 30, 2015 21:49
A small Subversion guide for Git users. Forked from http://blog.tfnico.com/2011/02/small-subversion-guide-for-git-users.html.

A small Subversion guide for Git users

(Forked from http://blog.tfnico.com/2011/02/small-subversion-guide-for-git-users.html.)

A recurring problem for us Git users is that we tend to forget the good old Subversion tricks. We want to do some patch on some old code in a Subversion repo, and suddenly we've got no idea how to work around.

Here's a quick guide:

> git pull

> svn update

@fiedl
fiedl / wingolfsplattform-re-clone.sh
Last active December 31, 2015 23:19
Wingolfsplattform Re-Clone.
# Siehe auch Trello: https://trello.com/c/irNlzi5l/462-repo-erneut-klonen
cd ~/rails
mv wingolfsplattform wingolfsplattform.to-delete
git clone [email protected]:fiedl/wingolfsplattform.git
mv ~/rails/wingolfsplattform.to-delete/config/database.yml ~/rails/wingolfsplattform/config/database.yml
cd ~/rails/wingolfsplattform
bundle exec rake
@fiedl
fiedl / sshfs.sh
Created January 5, 2014 11:48
mount ssh folder with rw access for my own user
# install tools (Mac OS)
brew install sshfs
# mount ssh folder with rw access for my own user
mkdir /Volumes/foo
sshfs [email protected]:/path/to/folder /Volumes/foo -o idmap=user -o uid=$(id -u) -o gid=$(id -g)
# References
#
# * http://wiki.ubuntuusers.de/FUSE/sshfs
@fiedl
fiedl / nas-e2fsck.sh
Created January 20, 2014 01:25
QNAP-NAS: How to check disk if cannot unmount when device is busy.
ssh admin@nas
/etc/init.d/services.sh stop
/etc/init.d/xdove.sh stop
# See if there are still files open on the disk:
lsof |grep /share/MD0_DATA
# Kill the open processes if any.
@fiedl
fiedl / i3-ports-mavericks.md
Last active August 29, 2015 14:01
Installing IceCube's I3_PORTS on Mac OS X 10.9 Mavericks

Installing IceCube's I3_PORTS on Mac OS X 10.9 Mavericks

Important: Installing the icecube tools through I3_PORTS is no longer the preferred way for Mac OS. The necessary tools should be installed using homebrew instead.

Unfortunately, the current guides are out of date at the moment. For an update on this, check the IRC chatroom: #icecube on irc.efnet.net. A good irc client for Mac OS is Colloquy.

For the meantime, I have prepared another gist guiding through the installation of the icecube simulation software.

@fiedl
fiedl / genie.cmake
Created June 13, 2014 11:22
Genie Cmake configuration Hack for homebrew on Mac OS X 10.9.
#
# Copyright (C) 2011
# Claudio Kopper <[email protected]>
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,