Skip to content

Instantly share code, notes, and snippets.

View inhji's full-sized avatar
🚲
I'll make better mistakes tomorrow.

Jonathan Jenne inhji

🚲
I'll make better mistakes tomorrow.
View GitHub Profile
@inhji
inhji / beta.js
Created April 23, 2014 12:22
small type checkign lib
(function (root) {
"use strict";
var nativeToString = Object.prototype.toString,
callToString = function (v) {
return nativeToString.call(v)
.replace(/\[object\s{1}|\]/g, "")
.toLowerCase();
},
@inhji
inhji / multi-export.js
Last active August 29, 2015 14:01
Multi Export (Browser, CommonJS, RequireJS)
// CommonJS
if (typeof exports !== "undefined") {
if (typeof module !== "undefined" && module.exports) {
exports = module.exports = betta;
}
// RequireJS
exports["\u00df"] = betta;
} else {
// Global method
root["\u00df"] = betta;
@inhji
inhji / main.js
Created May 19, 2014 08:55
Underscore, Underscore.string and RequireJS
requirejs.config({
paths: {
'backbone' : '../lib/backbone/backbone',
'backbone.base' : '../lib/backbone/backbone.base',
'backbone.extensions' : '../lib/backbone/backbone.extensions',
'jquery' : '../lib/jquery/jquery',
'text' : '../lib/require/text',
'underscore' : '../lib/underscore/underscore',
'underscore.mixed' : '../lib/underscore/underscore.mixed',
'underscore.string' : '../lib/underscore/underscore.string'
@inhji
inhji / betta.js-next
Last active August 29, 2015 14:03
Betta
/* ---------------------------------
___ __ __
\_ |__ _____/ |__/ |______
| __ \_/ __ \ __\ __\__ \
| \_\ \ ___/| | | | / __ \_
|___ /\___ >__| |__| (____ /
\/ \/ \/
ß("ßetta", "string");
// => true
@inhji
inhji / isso.js
Last active August 29, 2015 14:04
Isso
var isso = (function(root){
var value = undefined;
function isso(v){
return (v)? new inner(v): ex;
}
function inner(v){
this.value = v;
return this;
@inhji
inhji / betta_v2.js
Created August 20, 2014 08:56
betta_v2.js
var ß = (function(){
function _(value) {
this.value = value;
}
_.prototype = {
is: function(){
return new Object().toString.call(this.value).slice(8, -1).toLowerCase();
}
}
@inhji
inhji / atobtoa.js
Created September 22, 2014 12:58
AtoBtoA.js
//http://stackoverflow.com/questions/9786508/javascript-atob-returning-string-contains-an-invalid-character/9786592#9786592
function utf8_to_b64( str ) {
return window.btoa(unescape(encodeURIComponent( str )));
}
function b64_to_utf8( str ) {
return decodeURIComponent(escape(window.atob( str.replace(/\s/g, '') )));
}
@inhji
inhji / selectsort.java
Last active October 13, 2015 01:48
Select Sort
import java.util.ArrayList;
import java.util.Arrays;
public class selectsort {
/**
*
* Select Sort
*
* Ein Feld wird einmal vollständig durchlaufen. Dabei wird durch einfache Vergleiche das größte Element herausgesucht
@inhji
inhji / extensions.md
Last active December 16, 2015 03:29
Sublime Text 2 Config

Themes

Color Schemes

@inhji
inhji / patienten.java
Created April 12, 2013 09:14
Patienten Datenbank
import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;
public class Patienten {
public static ArrayList<patientItem> Data = new ArrayList<patientItem>();
public static String basePath = new String("/home/inhji/patienten.db");
public static String lim = new String("::");
public static Scanner s = new Scanner(System.in);
public static int encryptKey = 2;