Skip to content

Instantly share code, notes, and snippets.

Sebastian buk

Block or report user

Report or block buk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@buk
buk / Express
Created Feb 18, 2013
After the installation of Express.js the command 'express' to create new applications is not available
View Express
➜ Code npm install -g express
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/connect/2.7.2
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http GET https://registry.npmjs.org/cookie/0.0.5
npm http GET https://registry.npmjs.org/buffer-crc32/0.1.1
npm http GET https://registry.npmjs.org/fresh/0.1.0
@buk
buk / gauges.html
Created Nov 28, 2012
The gauges html file
View gauges.html
{% if site.gauges_tracking_id %}
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '{{ site.gauges_tracking_id }}');
t.src = '//secure.gaug.es/track.js';
@buk
buk / api_participant.rb
Created Nov 21, 2012
The Participant Model
View api_participant.rb
class ApiParticipant
def self.fetch_participants(&block)
BubbleWrap::HTTP.get("http://jugendgruppe-backend.192.168.2.105.xip.io/participants.json") do |response|
if response.ok?
json = BubbleWrap::JSON.parse(response.body)
participants = json.map {|pj| Participant.from_json(pj["participant"])}
p "You are here: #{self.name}: #{participants}"
block.call(true, participants)
@buk
buk / participants.json
Created Nov 21, 2012
All the participants as a JSON String
View participants.json
[{"participant":{"allergy":"Lactose Intolerant","created_at":"2012-11-20T05:40:07Z","date_of_birth":"2007-10-06","emergency_number":"xxxxxxxxxx","first_name":"Sebastian","group":"St. Peter","health_insurance_card":true,"id":1,"last_name":"Bachmann","swimmer":true,"updated_at":"2012-11-20T05:40:07Z","vaccination_certificate":true}},{"participant":{"allergy":"Fructose Intolerant","created_at":"2012-11-20T05:41:17Z","date_of_birth":"2008-03-03","emergency_number":"xxxxxxxxxx","first_name":"Johannes ","group":"St. Johannes","health_insurance_card":true,"id":2,"last_name":"Bachmann","swimmer":true,"updated_at":"2012-11-20T05:41:17Z","vaccination_certificate":true}}]
View participants.json
[{"allergy":"Lactose Intolerant","created_at":"2012-11-16T23:59:10Z","date_of_birth":"2012-11-16","emergency_number":"004962535377","first_name":"Sebastian","group":"St. Peter","health_insurance_card":true,"id":1,"last_name":"Bachmann","swimmer":true,"updated_at":"2012-11-17T00:44:16Z","vaccination_certificate":false},{"allergy":"Xanax","created_at":"2012-11-17T09:50:27Z","date_of_birth":"2013-11-17","emergency_number":"004962531546","first_name":"Markus","group":"St. Martin","health_insurance_card":true,"id":2,"last_name":"Bauer","swimmer":true,"updated_at":"2012-11-17T09:50:27Z","vaccination_certificate":true},{"allergy":"None","created_at":"2012-11-17T09:51:28Z","date_of_birth":"2007-01-03","emergency_number":"004962531546","first_name":"Christian","group":"Heiliger Franz von Asisi","health_insurance_card":false,"id":3,"last_name":"Bauer","swimmer":true,"updated_at":"2012-11-17T09:51:28Z","vaccination_certificate":false}]
@buk
buk / ParticipantsViewController
Created Nov 17, 2012
Load JSON Values and pass them to a UITableView - Rubymotion
View ParticipantsViewController
class ParticipantsTableViewController < UITableViewController
def viewDidLoad
super
BW::HTTP.get("http://jugendgruppe-backend.192.168.2.105.xip.io/participants.json") do |response|
json = BW::JSON.parse(response.body.to_str)
@posts = json["items"]
view.addSubview(@tableView)
end
@buk
buk / SettingsController
Created Oct 24, 2012
This is my formotion code
View SettingsController
class SettingsController < Formotion::FormController
include SettingsForm
def init
form = get_settings_form
super.initWithForm(form)
end
end
View gist:3905816
require 'rubygems'
require 'ipa_reader'
require 'plist'
require 'builder'
ipa_file = IpaReader::IpaFile.new("AdhocServerTest.ipa")
puts name = "Name:#{ipa_file.name}"
title = "#{ipa_file.name}"
puts bundleId = "Bundle Identifier: #{ipa_file.bundle_identifier}"
puts version = "Version: #{ipa_file.version}"
View gist:3905630
require 'rubygems'
require 'builder'
plist = File.open(title + '.plist', 'w') do |f|
end
def generate_plist_file
plist = Builder::XmlMarkup.new( :indent => 2 )
plist.instruct! :xml, :encoding => "UTF-8"
@buk
buk / plist error
Created Oct 9, 2012
error message in irb
View plist error
1.9.3-p194 :001 > require 'plist'
/Users/sebastian/.rvm/gems/ruby-1.9.3-p194/gems/plist-3.1.7/lib/plist/generator.rb:221: warning: else without rescue is useless
SyntaxError: /Users/sebastian/.rvm/gems/ruby-1.9.3-p194/gems/plist-3.1.7/lib/plist/generator.rb:216: syntax error, unexpected tLABEL
when String, Symbol: 'string'
^
/Users/sebastian/.rvm/gems/ruby-1.9.3-p194/gems/plist-3.1.7/lib/plist/generator.rb:217: syntax error, unexpected keyword_when, expecting keyword_end
when Fixnum, Bignum, Integer: 'integer'
^
/Users/sebastian/.rvm/gems/ruby-1.9.3-p194/gems/plist-3.1.7/lib/plist/generator.rb:217: dynamic constant assignment
when Fixnum, Bignum, Integer: 'integer'
You can’t perform that action at this time.