Skip to content

Instantly share code, notes, and snippets.

View derMani's full-sized avatar

Rolf Beh derMani

  • CEO, CTO - Bitnamic UG (haftungsbeschränkt)
  • Osnabrück, Germany
View GitHub Profile
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
NSString *urlString = [[request URL] absoluteString];
if ([urlString hasPrefix:@"js:"]) {
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject]
stringByReplacingPercentEscapes];
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
@derMani
derMani / GridStream.js
Last active September 5, 2020 19:07 — forked from psi-4ward/GridStream.js
NodeJS MongoDB-GridFS Video range stream exampleLets your browser seek/jump wihin the video-playback.
var express = require('express');
var app = express();
var mongo = require('mongodb');
var MongoClient = require('mongodb').MongoClient;
var GridStore = mongo.GridStore;
var ObjectID = require('mongodb').ObjectID;
function StreamGridFile(req, res, GridFile) {
@derMani
derMani / hashid.js
Last active January 24, 2021 18:48 — forked from fiznool/hashid.js
Short 'hash' ID generator.
'use strict';
/**
* The default alphabet is 25 numbers and lowercase letters.
* Any numbers that look like letters and vice versa are removed:
* 1 l, 0 o.
* Also the following letters are not present, to prevent any
* expletives: cfhistu
*/
var DEFAULT_ALPHABET =
window.URL = window.URL;
$("#videoDiv").remove();
$("body").prepend("<div id='videoDiv' style='background-color:black;z-index:99999999999999;position:absolute;left:0;top:0'><video id='myVideo' autoplay></video></div>");
if (window.localStream) {
window.localStream.getTracks().forEach(function(track) {
track.stop();
});
}