Skip to content

Instantly share code, notes, and snippets.


Luis Nell originell

Block or report user

Report or block originell

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
originell /
Last active Jan 11, 2019
Small Fish Intro

Notes about $PATH

You are probably used to lines like these in your shell config:

export PATH="/usr/local/opt/gettext/bin:$PATH"

Now, $PATH can also be modified like this in fish. However, it would not be very idiomatic.


Keybase proof

I hereby claim:

  • I am originell on github.
  • I am luisnell ( on keybase.
  • I have a public key ASB2zMHH4q3XTjUnERLfXYbpsesbZbpZpfo-FhUDUDffMgo

To claim this, I am signing this object:

originell / navStyleChanger.js
Last active Aug 29, 2015
Example: detect scroll position and change navi style
View navStyleChanger.js
// Navigationbar to be changed (cached here for performance, always grabbing
// it new in the scroll-callback is bad for performance)
var $navi = $('.myNav')
function changeNavStyle() {
var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
if (top > 200) {
} else {
originell / TopMostViewController.swift
Created Jan 7, 2015
Reliably get the top most UIViewController. Tested with iOS7 and 8
View TopMostViewController.swift
// Note: There are no fancy error checks in here. This is just meant to quickly demonstrate this.
// I was extremely frustrated because most posts on stackoverflow are missing the important point
// of checking for the "presentedViewController".
// If you are working in a view that is *already living* in the view hierarchy.
var topMostController = view.window!.rootViewController!
// or
// If you don't have a view in the hierarchy yet (as it might happen in viewDidLoad etc.)
// (there is also the possibility to use UIApplication.sharedApplication().keyWindow, though it seems
// that the internet's general opinion is that it's safer to use the delegate's window)
originell /
Last active Dec 6, 2018
This is a straight copy of – to avoid this ever going dark

Analysis of Apple’s rubber band scrolling

January 6, 2013

I recently saw a post on Twitter from @chpwn that described the alogorithm that Apple uses for its “rubber band” or “bungee” scrolling.

b = (1.0 – (1.0 / ((x * c / d) + 1.0))) * d
originell /
Created Feb 27, 2012
Python Traceback Extractor from text/log files.
Extract unique Python-Exceptions with their Traceback from a log/text file.
python -f logfile.txt
Furthermore it supports excluding exceptions you don't want to have::
python -f logfile.txt -e ValueError,AttributeError
originell /
Created May 11, 2011
XHTML 1.1 form to PHP Array.
# coding: utf-8
Convert a XHTML 1.1 compliant form to a php array with Python (YIKES! :D)
import re
# Put your form in here!
s = """
<form action="foobar.php" method="post" accept-charset="utf8">
originell /
Created May 4, 2011
Fastes way to search for something in a list
import pytz
import re
Trying to find a fast way to search through a list.
As example we use pytz's all_timezones list and set, which
are both pretty nicely filled with strings.
OSX 10.6.7, 2.53ghz Core2Duo:
originell /
Created Apr 22, 2011
Trying to build a regex validating the given URIs
#!/usr/bin/env python
# encoding: utf-8
Build URL Validation Regex.
See the according *\_urls list for a definition of what we
want to match and what not.
Note that according to RFC 2612 (HTTP 1.1, Section 3.1.2) there is
no such thing as a maximum URI length. Since servers should
You can’t perform that action at this time.