Skip to content

Instantly share code, notes, and snippets.

View alexander-heimbuch's full-sized avatar
🤔

Alexander Heimbuch alexander-heimbuch

🤔
View GitHub Profile
@alexander-heimbuch
alexander-heimbuch / hashmap.js
Last active October 22, 2015 13:47
Example Hashmap
var hashTable = function () {
// Task: Hashtable for every filetype
var hashCode = function (value) {
var hash = 0, i, chr, len;
value = value.toString();
if (value.length === 0) {
return hash;
}
@alexander-heimbuch
alexander-heimbuch / is_array.js
Last active December 23, 2015 09:46
Check if is Array
/**
* Check if is Array
*/
Object.prototype.isArray = function () {
if(Object.prototype.toString.call(this) === '[object Array]') {
return true;
}
return false;
@alexander-heimbuch
alexander-heimbuch / MVC.md
Created October 30, 2015 18:47
Development Patterns

Objective

  • Model View Controller pattern
  • Improved application organisation through a seperation of concerns
  • Explicit seperation from application logic from the user interface
  • Easier maintenance because the structure determines where changes have to be made
  • Decoupling data storage and visualization that enables a better unit testing
  • Avoid duplication of low level model and controllers
  • In JavaScript enforced by frameworks like Backbone, Ember.js or JavaScriptMVC
@alexander-heimbuch
alexander-heimbuch / 1_modi.md
Created October 30, 2015 18:51
Vi(m) Chetsheet

Modi

Modus verlassen: ESC + ESC

Visueller Zeilenmodus: V
Visueller Modus: v
Visueller Blockmodus: ctrl + v
Einfügemodus vor dem aktuellen Zeichen: i
Einfügemodus nach dem aktuellen Zeichen: a
Einfügemodus mit neuer Zeile danach: o

@alexander-heimbuch
alexander-heimbuch / cheatsheet.md
Created October 30, 2015 18:51
Docker Cheatsheet

Docker Cheat Sheet

Erzeugung von Images

Vorkonfigurierte Container über Docker Registry

Nutzung des docker repos

docker pull myuser/myapp

@alexander-heimbuch
alexander-heimbuch / patch.sh
Created December 1, 2015 09:01
Useful Git Commands
#!/bin/bash
# source: http://tosbourn.com/using-git-to-create-an-archive-of-changed-files/
git archive -o update.zip HEAD $(git diff --name-only HEAD^)
@alexander-heimbuch
alexander-heimbuch / webdev-boilerplate.sh
Last active December 18, 2015 15:50
Script for running the webdev boilerplate
#!/bin/sh
project=${PWD##*/}
git clone https://github.com/alexander-heimbuch/webdev-boilerplate.git .
rm -rf .git && \
sed -i '' "s/project-name/$project/g" package.json && \
npm i
@alexander-heimbuch
alexander-heimbuch / jquery.min.js
Last active December 23, 2015 10:35
Minimal jQuery Replacement
/**
* Minimal jQuery replacement
*/
(function () {
'use strict';
var find = function (element) {
return function (query) {
var results = element.querySelectorAll(query),
@alexander-heimbuch
alexander-heimbuch / object2array.js
Created December 23, 2015 09:46
Convert Array like Object to Array
/*
* Convert Array like Object to Array
* Source: http://xahlee.info/js/js_convert_array-like.html
*/
Object.prototype.toArray = function () {
return Array.prototype.slice.call(this);
}
// {0:"a", 1:"b",2:"c", length:3}.toArray() => ['a', 'b', 'c']
#!/bin/sh
unzip -qq instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
unzip -qq instantclient-basic-macos.x64-11.2.0.4.0.zip
cd instantclient_11_2
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/bin
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/lib
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/jdbc/lib
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/rdbms/jlib
mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/sqlplus/admin