Skip to content

Instantly share code, notes, and snippets.

View Niek's full-sized avatar

Niek van der Maas Niek

View GitHub Profile
@Niek
Niek / prebid-atomx.html
Last active April 12, 2017 09:07
Prebid Atomx example
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>Prebid Atomx example</title>
<head>
<body>
@Niek
Niek / adperium_banner_clicktag.as
Created February 22, 2011 13:13
Actionscript (3.0) code to handle clicks on a banner
// Default click URL
var url = "http://www.adperium.com/";
// Handle clickTAG
if (LoaderInfo(root.loaderInfo).parameters.clickTAG) {
url = LoaderInfo(root.loaderInfo).parameters.clickTAG;
}
clickTAG_button.addEventListener(MouseEvent.MOUSE_UP,
function(event:MouseEvent) {
if (ExternalInterface.available) {
ExternalInterface.call('window.open("' + url + '","_blank")');
@Niek
Niek / adperium_banner.as
Created February 22, 2011 12:29
Actionscript (3.0) code to match colors of a banner with the site it's showing on
// Allow access from Javascript
flash.system.Security.allowDomain("*");
// To be called from Javascript when colors are returned
function setcolors(colors) {
var bgcolor = new ColorTransform;
var fgcolor = new ColorTransform;
bgcolor.color = parseInt(colors[0].substr(1), 16);
fgcolor.color = parseInt(colors[1].substr(1), 16);
// Change the colors of objects in your banner to either fgcolor or bgcolor
@Niek
Niek / getlocation.sh
Created December 28, 2010 10:16
Get your physical location based on the MAC address of your WiFi access point (Mac OS X only)
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep BSSID | awk '{print $2}' | sed "s/^\(.\):/0\1:/" | sed "s/:\(.\):/:0\1:/g" | sed "s/:\(.\):/:0\1:/g" | sed "s/:\(.\)$/:0\1/" | xargs -I{} echo 'curl -s http://www.google.com/loc/json -d '\''{"version":"1.1.0","request_address":true,"wifi_towers": [{"mac_address":"{}"}]}'\'' | awk -F\" '\''{print "{} = "$32" "$36", "$28", "$12}'\''' | $SHELL
@Niek
Niek / .tisch.calib
Created November 18, 2010 16:26
Place in your homedir, so ~/.tisch.touchd and ~/.tisch.calib
-2 0 1280
0 -2 800
0 0 1
1 0 0 0
640 640 0
0.5 0.375 0