This file contains 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
import boto3 | |
from requests import get | |
client = boto3.client('route53') | |
ip = get('https://api.ipify.org').text | |
ipv6 = get('https://api64.ipify.org').text | |
HostedZoneId='(HOSTED ZONE ID)' |
This file contains 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
package com.example.jersey; | |
import javax.net.ssl.*; | |
import javax.ws.rs.client.Client; | |
import javax.ws.rs.client.ClientBuilder; | |
import javax.ws.rs.core.Configuration; | |
import java.security.KeyManagementException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.security.cert.CertificateException; |
This file contains 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 util = require('util'), | |
twitter = require('twitter'), | |
sys = require('sys'); | |
var twit = new twitter({ | |
consumer_key: '', | |
consumer_secret: '', | |
access_token_key: '', | |
access_token_secret: '' | |
}); |
This file contains 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
package eu.activelogic.xml.xstream.converters; | |
import java.lang.reflect.Field; | |
import org.apache.commons.lang.StringUtils; | |
import com.thoughtworks.xstream.converters.ConversionException; | |
import com.thoughtworks.xstream.converters.Converter; | |
import com.thoughtworks.xstream.converters.ConverterLookup; | |
import com.thoughtworks.xstream.converters.MarshallingContext; |
This file contains 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
def key(time, base, adjustment): | |
return (time+adjustment) - (time+adjustment)%base | |
def map_entries(index, entry): | |
if entry.type == "call": | |
yield (entry.number+entry.number_to+key(entry.time, 5*60, 0), entry) | |
elif entry.type == "SMS": | |
yield (entry.number+entry.number_to+key(entry.time, 5*60, 0), entry) | |
yield (entry.number+entry.number_to+key(entry.time, 5*60, -5*60), entry) | |
else: |
This file contains 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
def map_entries(index, entry): | |
if entry.type == "call" or entry.type == "SMS": | |
(entry.number, entry) | |
else: | |
(None, None) | |
def reduce_entries(key, entries): | |
for i in range(0, len(entries)) : | |
entry = entries[i] |
This file contains 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
def map_entries(index, entry): | |
return (entry.number, entry) | |
def reduce_entries(key, entries): | |
for i in range(0, len(entries)) : | |
entry = entries[i] | |
if entry.type == "call": | |
sms = find_sms(entries, | |
entry.number_to, |
This file contains 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
def find_sms(number, number_to, start, time_start, time_end): | |
for i in range(start, len(source)) : | |
entry = source[i] | |
if (entry.type == "sms" and | |
entry.number == number and | |
entry.number_to == number_to and | |
entry.time > time_start and | |
entry.time < time_end) : | |
return entry | |
elif entry.time > time_end: |
This file contains 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
def find_sms(number, number_to, time_start, time_end): | |
for entry in source: | |
if (entry.type == "sms" and | |
entry.number == number and | |
entry.number_to == number_to and | |
entry.time > time_start and | |
entry.time < time_end) : | |
return entry | |
for entry in source : |