Skip to content

Instantly share code, notes, and snippets.

@johanneswuerbach
johanneswuerbach / .travis.yml
Last active April 14, 2023 20:31
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@johanneswuerbach
johanneswuerbach / rails-vagrant-provision.sh
Last active June 29, 2020 19:24
Provision a vagrant box with ruby stable (using rvm), postgres, redis and node (using nvm)
#!/usr/bin/env bash
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8
sudo apt-get update
sudo apt-get install -y build-essential git curl libxslt1-dev libxml2-dev libssl-dev
# postgres
@johanneswuerbach
johanneswuerbach / README.markdown
Created May 16, 2012 16:43 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string

Keybase proof

I hereby claim:

  • I am johanneswuerbach on github.
  • I am johanneswuerbach (https://keybase.io/johanneswuerbach) on keybase.
  • I have a public key whose fingerprint is 4B18 6527 5920 FB9F 0723 ED74 74DB 0F4D 956C CCE3

To claim this, I am signing this object:

2013-07-14 15:04:59,164 - sauce_connect:558 - INFO - / Starting \
2013-07-14 15:04:59,167 - sauce_connect:559 - INFO - Please wait for "You may start your tests" to start your tests.
2013-07-14 15:04:59,176 - sauce_connect:571 - DEBUG - System is 2.0 hours off UTC
2013-07-14 15:04:59,177 - sauce_connect:573 - DEBUG - options: {'user': 'sixdoors_robot', 'ports': ['59497'], 'domains': None, 'debug_ssh': False, 'tunnel_ports': ['80'], 'allow_unclean_exit': False, 'rest_url': 'https://saucelabs.com/rest/v1', 'logfile': 'sauce_connect.log', 'squid_opts': '', 'ssh': False, 'se_port': '4445', 'readyfile': None, 'shared_tunnel': False, 'boost_mode': True, 'tunnel_identifier': 'karma1373807085', 'ssh_port': 443, 'fast_fail_regexps': '', 'direct_domains': '', 'host': '127.0.0.1', 'quiet': False, 'latency_log': 150, 'use_ssh_config': False}
2013-07-14 15:04:59,178 - sauce_connect:574 - DEBUG - metadata: {'PythonVersion': '2.5.1', 'OwnerHost': '127.0.0.1', 'Release': '3.0-r28', 'OwnerPorts': ['59497'], 'Ports': ['80'], '
@johanneswuerbach
johanneswuerbach / .bash_profile
Last active December 13, 2015 17:38
Faster Rails
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
@johanneswuerbach
johanneswuerbach / gist:4328963
Created December 18, 2012 15:29
webmock trace
/home/ubuntu/payment/vendor/bundle/ruby/1.9.1/gems/webmock-1.9.0/lib/webmock/http_lib_adapters/net_http.rb:250: [BUG] Segmentation fault
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0050 p:0010 s:0214 b:0212 l:000196 d:000211 BLOCK /home/ubuntu/payment/vendor/bundle/ruby/1.9.1/gems/webmock-1.9.0/lib/webmock/http_lib_adapters/net_http.rb:250
c:0049 p:---- s:0208 b:0208 l:000207 d:000207 FINISH
c:0048 p:---- s:0206 b:0206 l:000201 d:000205 IFUNC
c:0047 p:---- s:0204 b:0204 l:000203 d:000203 CFUNC :each
c:0046 p:---- s:0202 b:0202 l:000201 d:000201 CFUNC :inject
c:0045 p:0252 s:0198 b:0197 l:000196 d:000196 METHOD /home/ubuntu/payment/vendor/bundle/ruby/1.9.1/gems/webmock-1.9.0/lib/webmock/http_lib_adapters/net_http.rb:250
@johanneswuerbach
johanneswuerbach / robot.js
Created December 17, 2012 11:37
DeathAng3l2
// Conventions:
// We use angles in degrees in clock-wise fashion
RobotHelpers = {};
MathHelpers = {};
RobotHelpers.cannon_rotation_direction = {};
RobotHelpers.shoot = {};
RobotHelpers.target = {};
RobotHelpers.moving_direction = {};
@johanneswuerbach
johanneswuerbach / lazy_extract.rb
Last active October 13, 2015 19:38
Lazy extract rar archives.
#!/usr/bin/env ruby
require "rubygems"
require "thor"
require "pty"
class LazyExtract < Thor
desc "extract archive", "lazy extract an archive"
method_option :password, :aliases => "-p", :desc => "Password for protected archives."
method_option :verbose, :default => false, :aliases => "-v", :desc => "Print unrar output."
@johanneswuerbach
johanneswuerbach / test_connection.rb
Created October 15, 2012 19:19
Test database connection
require "mysql"
require "json"
db_host = ""
db_user = ""
db_pass = ""
db_name = ""
# Test database conneciton
requests = 0