Skip to content

Instantly share code, notes, and snippets.

@aloyr
aloyr / click_as.bml
Created March 4, 2017 00:07 — forked from wheeyls/click_as.bml
BigMachines SOAP Calls
/**
* param {String} sessionId
* param {String} bs_id
* param {String} sitename
* param {String} action_var_name
* param {String [][] } attr sets of attributes to set. Format: [[docnum, varname, value], [docnum, varname, value]...]
* param {String} error_string
*
* return {String} the soap response
*/
// Ensure url has 'www' and uses SSL
if (isset($_SERVER['PANTHEON_ENVIRONMENT']) && ($_SERVER['PANTHEON_ENVIRONMENT'] === 'live') &&
(php_sapi_name() != "cli")) {
$do_redirect = FALSE;
$url_chunks = explode('.', $_SERVER['HTTP_HOST']);
if ($url_chunks[0] != 'www') {
array_unshift($url_chunks, 'www');
$do_redirect = TRUE;
}
if (strtolower($_SERVER['HTTPS']) != 'on') {
@aloyr
aloyr / uri.js
Created February 23, 2016 21:04 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@aloyr
aloyr / gist:d017880a7be5ecf78b56
Created October 9, 2015 06:12 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@aloyr
aloyr / hid-ibm-gemalto-fp-payload-size
Created August 5, 2015 14:14
hid-ibm-gemalto-fp-payload-size
# root@li496-11(pts/0) ~
ll -h /tmp/*pcap
-rw-r--r-- 1 root root 4.3M Jul 25 17:36 /tmp/gemalto.pcap
-rw-r--r-- 1 root root 8.0M Jul 25 17:28 /tmp/hid.pcap
-rw-r--r-- 1 root root 1.2M Jul 25 17:34 /tmp/ibm.pcap
@aloyr
aloyr / gemalto-hp-hosts
Last active August 29, 2015 14:26
requests per host on a front page visit - gemalto
76 total
# root@li496-11(pts/0) ~
tcpdump -nn -i any -s0 -e -A -r /tmp/gemalto.pcap | grep Host | sort | uniq -c | sort -n
reading from file /tmp/gemalto.pcap, link-type LINUX_SLL (Linux cooked)
1 Host: blog.gemalto.com
1 Host: content.mkt51.net
1 Host: p.typekit.net
2 Host: fr.sitestat.com
5 Host: use.typekit.net
65 Host: www.gemalto.com
@aloyr
aloyr / ibm-fp-hosts
Last active August 29, 2015 14:26
requests per host on a front page visit - ibm
74 total
# root@li496-11(pts/0) ~
tcpdump -nn -i any -s0 -e -A -r /tmp/ibm.pcap | grep Host | sort | uniq -c | sort -n
reading from file /tmp/ibm.pcap, link-type LINUX_SLL (Linux cooked)
1 Host: data.cmcore.com
1 Server: AkamaiGHost
2 Host: libs.coremetrics.com
2 Host: service.maxymiser.net
2 Host: tmscdn.coremetrics.com
3 Host: consent.truste.com
@aloyr
aloyr / hid-fp-hosts
Last active August 29, 2015 14:26
requests per host on a front page visit - hid
147 total
# root@li496-11(pts/0) ~
tcpdump -nn -i any -s0 -e -A -r /tmp/phantomjs.pcap | grep Host | sort | uniq -c | sort -n
reading from file /tmp/phantomjs.pcap, link-type LINUX_SLL (Linux cooked)
1 Host: 289-tsc-352.mktoresp.com
1 Host: dnn506yrbagrg.cloudfront.net
1 Host: googleads.g.doubleclick.net
1 Host: munchkin-cdn.marketo.net
1 Host: munchkin.marketo.net
1 Host: p.jwpcdn.com
@aloyr
aloyr / filereadertest.html
Created July 28, 2015 04:48
test of filereader js api
<!DOCTYPE html>
<!-- code below from http://stackoverflow.com/a/13709663/187468 -->
<html>
<head>
<title>Read File (via User Input selection)</title>
<script type="text/javascript">
var reader; //GLOBAL File Reader object for demo purpose only
/**
* Check for the various File API support.