Skip to content

Instantly share code, notes, and snippets.

View kopa's full-sized avatar

Konrad Paumann kopa

  • Konrad Paumann
  • Zwettl
View GitHub Profile
@kopa
kopa / cvimrc.vim
Last active April 6, 2017 14:03
Settings file for cvim
" Settings
" alias ':g' to ':tabnew google'
command g tabnew google
let completionengines = ["google", "amazon", "imdb"]
" blacklists prefixed by '@' act as a whitelist
let blacklists = ["https://mail.google.com/*", "*://mail.google.com/*", "@*://*orf.at/*"]

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kopa
kopa / git cheat sheet
Last active December 26, 2015 20:49
git cheat sheet derived from http://cheat.errtheblog.com/s/git
Setup
-----
git clone <repo>
Info
----
git reflog
Use this to recover from *major* mess ups! It's basically a log of the
last few actions and you might have luck and find old commits that
<div ng-repeat="m in milestone_choices" class="row-fluid">
<label><input type="radio" name="meaningless" value="(( $index ))" ng-model="milestone_data.index" />
&nbsp;<span ng-bind="m.title"></span></label>
</div>
@kopa
kopa / Readme.md
Created April 16, 2013 08:27 — forked from NV/Readme.md

stopBefore.js

2min screencast

Examples

stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
@kopa
kopa / uuid.js
Created March 28, 2013 09:42 — forked from jcxplorer/uuid.js
function uuid() {
var uuid = "", i, random;
for (i = 0; i < 32; i++) {
random = Math.random() * 16 | 0;
if (i == 8 || i == 12 || i == 16 || i == 20) {
uuid += "-"
}
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16);
}

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@kopa
kopa / gist:4191601
Created December 2, 2012 23:41 — forked from paulirish/gist:4158604
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@kopa
kopa / uri.js
Created September 7, 2012 12:15 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"