Skip to content

Instantly share code, notes, and snippets.

View skreutzberger's full-sized avatar

Sebastian Kreutzberger skreutzberger

View GitHub Profile
@skreutzberger
skreutzberger / randomIntInRange.swift
Last active August 29, 2015 14:27
generate random Int within range in Swift
// returns a random int within given range
func randomInt(from: Int, to: Int) -> Int {
let range = UInt32(to - from)
let rndInt = Int(arc4random_uniform(range + 1)) + from
return rndInt
}
@skreutzberger
skreutzberger / gist:1132230
Created August 8, 2011 17:25
Keepalive of Nginx
#!/bin/bash
# shell script which checks if nginx is still running
# if not then it restarts the processes, including php-fpm
# this script should be called by a Cronjob every minute
# change the process name to whatever you want to keep alive:
PROCESS="nginx"
if ps ax | grep -v grep | grep $PROCESS > /dev/null
@skreutzberger
skreutzberger / ctprompt.sh
Created November 3, 2011 07:48
Custom Terminal Prompt
# add the following block to your ~/.bash_profile
# it will print more information and an extra char at the new line
# you can also use the Apple logo as character, just replace ⌘ with 
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
GREEN="\[\033[0;32m\]"
@skreutzberger
skreutzberger / spydev.md
Created January 15, 2012 06:45
Senior Python Dev

#Open Position "Senior Python Developer Berlin"

For a stealth hightech startup in Berlin, I am searching for 2 Senior Python Developers. The current dev team already exists of awesome UI, frontend, backend and sysadmin guys. The startup is in incubation stage, that’s why there is no website, yet.

Required professional experience:

  • 3yrs Python dev

  • 2yrs another web language

  • Amazon Web Services
  • Python Boto & Gevent
@skreutzberger
skreutzberger / js-dev-berlin.md
Created August 27, 2012 12:20
Senior Frontend Developer Berlin

#Open Position "Senior Frontend Developer Berlin"

For our stealth high-tech cloud startup in Berlin, I am searching for a capable member for our team of frontend hackers. The main task would be implementing our new browser-based web app on mobile and desktop devices and overcoming current limitations in the different implementations of the HTML5 standard. The web app sets new standards in user interface and what you can do in the browser and actually looks more like a computer game than a mobile web interface. That’s why knowledge in vector graphics programming, animation etc. is required.

In general, it is a technically very challenging high-tech position. That’s why we are looking for experienced frontend hackers with a flexible mindset and skills in software design and coding and a reputation in the open source community.

Required professional experience:

  • Javascript and another web language
  • Backbone.js
@skreutzberger
skreutzberger / sb-carthageissue1.log
Created December 10, 2015 09:29
Carthage Issue Log
Build settings from command line:
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphonesimulator9.2
=== BUILD TARGET SwiftyBeaver (iOS) OF PROJECT SwiftyBeaver WITH CONFIGURATION Release ===
Check dependencies
Write auxiliary files
write-file /Users/sebastian/Library/Developer/Xcode/DerivedData/SwiftyBeaver-afdkbmzqyrmnmdcgjtcdgpqjjvcp/Build/Intermediates/SwiftyBeaver.build/all-product-headers.yaml
@skreutzberger
skreutzberger / log2docdir.swift
Last active July 4, 2016 07:34
Log to Document Directory
// sends SwiftyBeaver logs to a file in your app’s document directory
// instead of the default caches directory
// learn more about SwiftyBeaver at https://github.com/SwiftyBeaver/SwiftyBeaver
let fm = NSFileManager.defaultManager()
if let docsURL = fm.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).first {
let file = FileDestination()
file.logFileURL = docsURL.URLByAppendingPathComponent("my.log")
log.addDestination(file)
log.info("writing logs to \(file.logFileURL)")
@skreutzberger
skreutzberger / spm1.sh
Last active September 17, 2016 08:12
SPM article Gist
mkdir MyProject
cd MyProject
swift package init --type executable
# will create the following output
> Creating executable package: MyProject
> Creating Package.swift
> Creating .gitignore
> Creating Sources/
> Creating Sources/main.swift
@skreutzberger
skreutzberger / spm5.sh
Created September 17, 2016 08:19
SPM article Gist 5
swift build --clean
@skreutzberger
skreutzberger / spm3.sh
Last active September 17, 2016 08:32
SPM article Gist 3
swift package update
> Cloning https://github.com/SwiftyBeaver/SwiftyBeaver.git
> HEAD is now at 83a0dd4 colored Emojis for native Xcode 8 Console support
> Resolved version: 1.0.1