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 os | |
import subprocess | |
from collections import defaultdict | |
from tqdm import tqdm | |
repo_path = "./" | |
valid_extensions = ['.kt', '.java', '.xml', '.py', '.js', '.html', '.css', '.kts', '.bat', '.sh', '.md', '.yml'] | |
translation_files = ['strings.xml', 'fastlane', '/raw/', 'README.md'] | |
ignored_files = ['.idea'] |
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
echo ${ENCODED_FILE_AS_ENVIRONMENT_VARIABLE} | base64 -d > decoded.txt |
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
#define FADE 3 | |
int max_brightness = 255 - FADE; | |
int min_brightness = FADE; | |
int brightness[4] = {240, 230, 225, 200}; | |
int pins[4] = {5, 10, 6, 3}; | |
int fade[4] = {FADE, FADE, FADE, FADE}; |
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 cv2 | |
import sys | |
import numpy as np | |
BLUR_LOW = 20 | |
BLUR_MED = 50 | |
BLUR_HIGH = 100 | |
def adjust_gamma(image, gamma=1.0): | |
# from: https://www.pyimagesearch.com/2015/10/05/opencv-gamma-correction/ |
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 gi | |
import time | |
gi.require_version('Notify', '0.7') | |
from gi.repository import Notify | |
from ouimeaux.environment import Environment | |
def print_name(light): | |
print light.name | |
env = Environment() |
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 Time = function(hour, minute, second){ | |
var getNextOccurrence = function(){ | |
var date = new Date(); | |
date.setHours(hour, minute, second); | |
var currentTime = new Date(); | |
// If the alarm time is in the past, move it to the next day | |
if(date.getTime() < currentTime.getTime()){ |
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
# chi_square_test : [(number, number)] -> number | |
# consumes a list of tuples containing the observed data and expected data | |
# produces the chi squared term of the dataset | |
def chi_square_test(data_points): | |
s = 0 | |
for point in data_points: | |
o, e = point | |
s += (o - e)**2/float(e) | |
return s |
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 org.usfirst.frc.team5112.robot; | |
import org.opencv.core.Range; | |
import com.thegongoliers.geometry.Point; | |
import com.thegongoliers.geometry.Pose; | |
import com.thegongoliers.geometry.Quaternion; | |
import com.thegongoliers.input.EnhancedXboxController; | |
import com.thegongoliers.input.camera.Camera; |
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
function Sheet(key){ | |
this.key = key; | |
this.baseurl = "https://spreadsheets.google.com/pub?key="+this.key+"&hl=en&output=tsv"; | |
} | |
Sheet.prototype.fetchAsync = function(pageId, callback){ | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.onreadystatechange = function() { | |
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) | |
callback(_getSheetData(xmlHttp.responseText)); |
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 matplotlib.pyplot as plt | |
""" | |
moving_average : list[float] int -> list[float] | |
Consumes a list of floats and computes the moving average with a window | |
size of window_size | |
""" |
NewerOlder