Skip to content

Instantly share code, notes, and snippets.

View pvorb's full-sized avatar
🏠
Working from home

Paul Vorbach pvorb

🏠
Working from home
View GitHub Profile
@pvorb
pvorb / awesome-php.md
Last active December 15, 2015 05:29 — forked from ziadoz/awesome-php.md

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

One-to-Many relationship

In some web applications, we need to define a one-to-many relationship between two entities. For example, let's take github.

Example: One-to-Many relationship exists between user and repository. User pksunkara have 2 repositories octonode and hub

The entities are defined as the following:

var resourceful = require('resourceful');
@pvorb
pvorb / 2^2048
Created January 31, 2013 00:14
2^2048
2^2048 =
32317006071311007300714876688669951960444102669715484032130345427524655138867890
89319720141152291346368871796092189801949411955915049092109508815238644828312063
08773673009960917501977503896521067960576383840675682767922186426197561618380943
38476170470581645852036305042887575891541065808607552399123930385521914333389668
34242068497478656456949485617603532632205807780565933102619270846031415025859286
41771167259436037184618573575983511523016459044036976132332872312271256847108202
09725157101726931323469678542580656697935045997268352998638215525166389437335543
602135433229604645318478604952148193555853611059596230656
@pvorb
pvorb / sbt-doc.log
Created November 28, 2012 13:30
sbt doc fails with java annotation
[info] Loading global plugins from C:\Users\Paul\.sbt\plugins
[info] Set current project to cataract (in build file:/C:/Dev/Scala/cataract/)
[info] Loading global plugins from C:\Users\Paul\.sbt\plugins
[debug] Running task... Cancelable: false, check cycles: false
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()

Almost one year ago I wrote an article that dealt with an emerging WebKit CSS technique, the CSS filter effects, and the question if we could not have/emulate them in other browsers, too. Turned out we could.

Today I want to talk about another WebKit-only technique and show you how you might be able to use it across all of the browsers: This is about...

CSS masks

CSS masks were added to the WebKit engine by Apple quite a while ago, namely back in April 2008. Masks offer the ability to control the opacity/transparency of elements on a per-pixel basis, similar to how the alpha/transparency-channel of "24-bit"-PNGs or 32-bit-TIFFs work.

These images consist of the usual R(ed) G(reen) and B(lue) channels that define the colors of each pixel. But on top there is a fourth channel, the alpha channel, that defines every pixel's opacity through luminance: White meaning opaque, black meaning transparent, and countless grey-values defining the semi-transparent inbet

var test = require('test');
@pvorb
pvorb / time.js
Created March 21, 2012 02:11
Log the time on every second
setInterval(function () {
console.log(getTime(new Date()));
}, 1000);
function pad(n) {
return n < 10 ? '0'+n : n;
}
function getTime(dt) {
return pad(dt.getHours())+':'+pad(dt.getMinutes())+':'+pad(dt.getSeconds());
@pvorb
pvorb / mfc42ul_3.6.44.idc
Created November 3, 2011 00:27
Staatstrojaner
This file has been truncated, but you can view the full file.
//
// +-------------------------------------------------------------------------+
// | This file has been generated by The Interactive Disassembler (IDA) |
// | Copyright (c) 2011 Hex-Rays, <support@hex-rays.com> |
// | License info: 11-1111-1111-11 |
// | Bernd Zerlegt, The Internet |
// +-------------------------------------------------------------------------+
//
//
@pvorb
pvorb / split-germany.js
Created August 19, 2011 21:17
Split germany.osm into 20 handy chunks with Osmosis and Node.js
var n = 55.304138,
e = 15.380859,
s = 47.040182,
w = 4.394531;
var width = e - w,
height = n - s;
console.log("Width: " + width);
console.log("Height: " + height);
@pvorb
pvorb / backup.sh
Created July 28, 2011 08:53
Backup script
#!/bin/bash
# Sichert die Dateien auf host
DIR="tmp"
if [ -d $DIR ]; then
cd $DIR
else
mkdir $DIR
cd $DIR