Skip to content

Instantly share code, notes, and snippets.

View christoffer's full-sized avatar
💫

Christoffer Klang christoffer

💫
View GitHub Profile
var scrollTopBeforeIframe = $window.scrollTop();
$window.one('scroll', function(e) {
console.log('window scroll event @' + $window.scrollTop() + ', reverting to ' + scrollTopBeforeIframe);
$window.scrollTop(scrollTopBeforeIframe);
});
@christoffer
christoffer / andr
Last active December 23, 2015 12:39
Dirty, but working, little bash script for day-to-day android development
#!/bin/bash
set -e
if [[ -z $ANDR_TARGET ]]
then
ANDR_TARGET="emulator"
fi
if [[ $ANDR_TARGET = "device" ]]
@christoffer
christoffer / symbol_envy.java
Created September 9, 2013 20:47
Missing symbols from ruby.
package com.my.package;
static import com.my.package.Symbols.*;
class MyClass {
// Symbol constants
enum Symbols { EXTRA_SOME_KEY }
void unpackExtras() {
Bundle extras = getIntent().getExtras();
<!-- Back to top -->
<script type="text/javascript">
$("#toTop").click(function (event) {
event.preventDefault();
//1 second of animation time
//html works for FFX but not Chrome
//body works for Chrome but not FFX
//This strange selector seems to work universally
$("html, body").animate({scrollTop: 0}, 1000);
@christoffer
christoffer / bash_rc
Last active December 20, 2015 02:39
Configs
export EDITOR=vim
export PS1="\n\w\n\$ "
export TERM=xterm-256color
alias gb="git branch"
alias gg="git grep"
alias gs="git status"
alias ga="git add"
alias gd="git diff"
alias gc="git commit"
@christoffer
christoffer / gist:5159882
Created March 14, 2013 08:49
Two aliases that I've found useful in the daily routine of branching, working, sending for review
alias gpublish="git push --set-upstream origin `git rev-parse --abbrev-ref HEAD`"
alias gpullreq="open https://github.com/Readmill/web/pull/new/`git rev-parse --abbrev-ref HEAD`"