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 requests | |
from treelib import Tree | |
root_project = "aws-c-common" | |
base_url = "https://raw.githubusercontent.com/awslabs/{}/main/builder.json" | |
seen_deps = set() |
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
import json | |
import gzip | |
import base64 | |
import StringIO | |
from vcr.serialize import deserialize | |
from vcr.serializers import yamlserializer | |
path = '../cassettes/api-InstagramAPITestCase-test_media.yml' |
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 time | |
import logging | |
import pync | |
import requests | |
log = logging.getLogger(__name__) | |
url = 'https://www.facebook.com/feeds/api_status.php' |
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
import sys | |
import math | |
def find_primes(max_number): | |
is_composite = range(0, max_number + 1) | |
for i in range(4, max_number, 2): | |
is_composite[i] = True |
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
import sys | |
import math | |
def find_factors(number): | |
factors = [] | |
while number % 2 == 0: | |
factors.append(2) | |
number = number / 2 | |
i = 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
def availability(start, end, blocks): | |
"""Return a new list of tuples of ints, where those ints | |
represent the time ranges between start and end that | |
don't intersect with any blocks. | |
Keyword arguments: | |
start -- earliest start time we care about | |
end -- latest end time we care about | |
blocks -- list of tuples of ints that we wish to exclude | |
return -- list of tuples of ints |
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
def availability(start, end, blocks): | |
"""Return a new list of tuples of ints, where those ints | |
represent the time ranges between start and end that | |
don't intersect with any blocks. | |
Keyword arguments: | |
start -- earliest start time we care about | |
end -- latest end time we care about | |
blocks -- list of tuples of ints that we wish to exclude | |
return -- list of tuples of ints |
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
import random | |
num_steps = 0 | |
def collatz(term): | |
"""Recursively compute the Collatz conjecture for a Natural number | |
http://en.wikipedia.org/wiki/Collatz_conjecture | |
term: | |
A natural number > 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
import re | |
import urllib2 | |
import base64 | |
def decode(data): | |
try: | |
return base64.decodestring(data) | |
except: | |
return data |
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
#include <Wire.h> | |
#define BAUD (9600) /* Serial baud define */ | |
#define _7SEG (0x38) /* I2C address for 7-Segment */ | |
#define THERM (0x49) /* I2C address for digital thermometer */ | |
#define EEP (0x50) /* I2C address for EEPROM */ | |
#define RED (3) /* Red color pin of RGB LED */ | |
#define GREEN (5) /* Green color pin of RGB LED */ | |
#define BLUE (6) /* Blue color pin of RGB LED */ | |
#define SPKOUT (9) |
NewerOlder