This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import base64 | |
| import sys | |
| input = sys.argv[1] | |
| def get_combinations(s): | |
| return [base64.urlsafe_b64encode('a'*i + s)[2*i:-4] for i in range(3)] | |
| for x in [get_combinations(intermediate) for intermediate in get_combinations(sys.argv[1])]: | |
| for y in x: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!geolocationContextAdded && navigatorAlias.geolocation && navigatorAlias.geolocation.getCurrentPosition) { | |
| navigator.geolocation.getCurrentPosition(function (position) { | |
| var coords = position.coords; | |
| var geolocationContext = { | |
| schema: 'iglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0', | |
| data: { | |
| latitude: coords.latitude, | |
| longitude: coords.longitude, | |
| latitudeLongitudeAccuracy: coords.accuracy, | |
| altitude: coords.altitude, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getRootDomain() { | |
| var split = window.location.hostname.split('.'); | |
| var position = split.length - 1; | |
| while (position >= 0) { | |
| var currentDomain = split.slice(position, split.length).join('.'); | |
| document.cookie = 'unique=unique;domain=' + currentDomain + ';'; | |
| if (document.cookie.indexOf('unique') > -1) { | |
| return currentDomain; | |
| } | |
| position -= 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| implicit class RichDfType(df: DfType) { | |
| def f(pairs: List[(String, AType)]): DfType = pairs match { | |
| case head :: tail => df.withColumn(head._1, head._2).f(tail) | |
| case Nil => df | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| aws kinesis describe-stream --stream-name $1 | | |
| jq '.StreamDescription.Shards | map(select(.SequenceNumberRange.EndingSequenceNumber == null))' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import base64 | |
| import sys | |
| input = sys.argv[1] | |
| drop = [0, 2, 3] | |
| def get_combinations(s): | |
| return [(base64.urlsafe_b64encode('a'*i + s)[drop[i]:]).replace('=', '') for i in range(3)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| path=$1; | |
| schema=$2; | |
| # String manipulation to extract "s3://first_part_of_path/" | |
| path_prefix=$(echo $1 | sed 's_\(^s3://[^/]*/\).*$_\1_g'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # | |
| # link-validator.py | |
| # Brandon Amos <http://bamos.io> | |
| import argparse | |
| import re | |
| from functools import lru_cache | |
| from urllib.request import urlopen | |
| from urllib.parse import urljoin,urldefrag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import fileinput | |
| import sys | |
| import re | |
| domain = None | |
| ignored_lines = 0 | |
| for line in fileinput.input(): | |
| if line == "\n": | |
| break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var page = require('webpage').create(); | |
| var system = require('system'); | |
| if (system.args.length === 1) { | |
| console.log('Usage: you must provide some URL to check'); | |
| phantom.exit(); | |
| } | |
| page.open(system.args[1], function(status) { | |
| var usesSnowplow; | |
| var information; | |
| if(status === "success") { |