Skip to content

Instantly share code, notes, and snippets.

View wemakeweb's full-sized avatar
🚀
Scaling Ampeers

Sebastian Otto wemakeweb

🚀
Scaling Ampeers
View GitHub Profile
- (void)pdfViewController:(PSPDFViewController *)pdfController willShowAnnotationView:(UIView <PSPDFAnnotationView> *)annotationView onPageView:(PSPDFPageView *)pageView {
if ([annotationView isKindOfClass:[PSPDFLinkAnnotationView class]]) {
PSPDFLinkAnnotationView *linkAnnotation = (PSPDFLinkAnnotationView *)annotationView;
linkAnnotation.borderColor = [[UIColor blueColor] colorWithAlphaComponent:0];
}
}
{
%name% Wochenkarte15
%start% 12.06.2012
%end% 13.06.2012
%type% wochenkarte
%file% 1
}
{
%name% Wochenkarte15
@wemakeweb
wemakeweb / scrollwatcher.js
Created October 25, 2012 20:52
Scrollwatcher - simple waypoint -requires jQuery and mousewheel plugin
function ScrollWatcher(){
this.watchers = [];
this.lastY = 0;
this.first = true;
var scroll = function(event){
var y = window.pageYOffset,
self = this,
diff = y - this.lastY,
dir = diff >= 0 ? 'down' : 'up';
function Animation(e, t, n, r) {
this.offset = r || function() {
return 0
}, r = this.offset(viewportHeight), this.element = e;
var i = e.offsetTop;
this.start = i + r, this.height = e.offsetHeight, this.end = this.height + i, this.state = 0, this.animation = t, this.reset = n
}
window.requestAnimFrame = function() {
@wemakeweb
wemakeweb / dom.js
Last active December 11, 2015 04:39
var twitter = require('twit');
var http = require('http');
var https = require('https');
var feed = new twitter({
consumer_key : '...',
consumer_secret : '...',
access_token : '...',
access_token_secret : '...'
});
var radium=[];
if("undefined"==typeof radium.init){var readatURL="",ctrl;(function(){var f=function(){var d=document.body,j=document.documentElement,l=function(b,a){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},k=function(b,a,c){b=document.createElement(b);l(a,b);l(c,b.style);return b},f=function(){var b,a=function(){window.removeEventListener("blur",a,!1);m(b);return!0};return function(c){b=c.target||c.srcElement;window.removeEventListener("blur",a,!1);"IMG"==b.nodeName&&"A"!=b.parentNode.nodeName&&(window.addEventListener("blur",
a,!1),setTimeout(function(){document.removeEventListener("blur",a,!1)},1E3));return!0}}(),n=function(){},o=function(b){m(b.target||b.srcElement,!0)},e;radium.inited?e=function(){}:(radium.inited=!0,e=function(){window.addEventListener?(navigator.userAgent.match("Firefox/2")||d.addEventListener("copy",o,!1),window.addEventListener("mousedown",n,!1),document.addEventListener("contextmenu",f,!1)):(d.attachEvent("oncopy",o),d.attachEvent("onmousedown",n));return function(b,a){var c;
@wemakeweb
wemakeweb / store.js
Last active December 12, 2015 00:18
Simple Key-Value Store for MeetNow! Better Javascript Series.
var Store = (function(){
var db = {},
each = function(obj, fn){
for (var key in obj) {
fn(key, obj[key]);
}
};
return {
set : function(key, value){
function createBinaryString (nMask) {
for (var nFlag = 0, nShifted = nMask, sMask = ""; nFlag < 32; nFlag++, sMask += String(nShifted >>> 31), nShifted <<= 1);
return sMask.slice(-8);
}
@wemakeweb
wemakeweb / gist:5030431
Created February 25, 2013 15:10
data views
view
===
<id:1 parent:0 name:Produkte>
<id:2 parent:1 name:TextilChemie>
<id:3 parent:2 name:ProduktA>
<id:4 parent:2 name:ProduktB>
<id:5 parent:0 name:Unternehmen>
<id:6 parent:5 name:Philosophie>
view_document_relation
@wemakeweb
wemakeweb / imageProcessor.js
Last active December 14, 2015 05:49
node-imagemagic-wrapper do process different image styles
var _ = require('underscore'),
inherits = require('util').inherits,
EventEmitter = require('events').EventEmitter,
imagemagick = require('imagemagick');
function ImageProcessor(options){
if(!options.image){
throw new Error("Provide an image to convert");
}