Skip to content

Instantly share code, notes, and snippets.

View DavidARivkin's full-sized avatar

David Rivkin DavidARivkin

View GitHub Profile
@Tbruno25
Tbruno25 / automatic_button_programming.ino
Created September 3, 2019 03:24
Automatic Button Programming
// this sketch was brutally hacked together by TJ Bruno --- https://medium.com/@tbruno25
#include <Print.h>
#include <mcp_can.h>
#include <SPI.h>
#include <EEPROM.h>
#define CAN0_INT 2
MCP_CAN CAN0(10);
class GoogleMapsQueryArgsDeserializer
{
public static function deserialize(string $input): array
{
$params = explode('!', trim($input, '!'));
foreach ($params as $i => $param) {
$params[$i] = urldecode($param);
}
@RockfordWei
RockfordWei / drawable_gen.sh
Created July 14, 2019 15:26
android drawables generator
#!/bin/bash
# brew install imagemagick
if [ -z "$1" ]
then
echo "drawable generator for android"
echo "usage: $0 [highest resolution image] [parent path of drawables]"
exit
else
img=$1
fi
@dlegor
dlegor / ThresholdingAlgo2.py
Created March 7, 2019 03:13
Python implementation of smoothed z-score algorithm version 2, from http://stackoverflow.com/a/22640362/6029703
from numba.decorators import jit
import numpy as np
#The original version is here: https://gist.github.com/ximeg/587011a65d05f067a29ce9c22894d1d2
#I made small changes and used numba to do it faster.
@jit
def thresholding_algo2(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
@amostajo
amostajo / script.php
Last active March 12, 2019 07:54
PHP license key client: Quick script tutorial
<?php
use LicenseKeys\Utility\Api;
use LicenseKeys\Utility\Client;
use LicenseKeys\Utility\LicenseRequest;
// -------------------------------------
// -------------------------------------
// -------------------------------------
// -------------------------------------
@coinsandsteeldev
coinsandsteeldev / dialog.html
Last active February 7, 2024 11:23 — forked from arthurattwell/dialog.html
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<!DOCTYPE html>
<html>
<head>
<script>
var data
var formId = 'form'
function drawForm() {
if (!data) return
var outputEl = document.getElementById(formId);
@ximeg
ximeg / ThresholdingAlgo.py
Created April 20, 2017 07:20
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
#!/usr/bin/env python
# Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703
import numpy as np
import pylab
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
avgFilter = [0]*len(y)
stdFilter = [0]*len(y)
@katylava
katylava / importS3Csv.gs
Last active August 7, 2023 14:37
Google Apps Script to import a CSV, stored securely on S3, to a Google Spreadsheet
var AWS_KEY = '<your key>';
var AWS_SECRET = '<your secret>';
function generateS3Url(bucket, path) {
var expiresDt = Math.floor(Date.now() / 1000) + (60 * 60 * 24); // can be up to 7 days from now
var stringToSign = 'GET\n\n\n' + expiresDt + '\n/' + bucket + '/' + encodeURIComponent(path);
var hmac = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_1, stringToSign, AWS_SECRET, Utilities.Charset.UTF_8);
var signed = encodeURIComponent(Utilities.base64Encode(hmac));
@tbreuss
tbreuss / dnsbl.php
Last active December 21, 2023 20:29
IP Blacklist Check Script - This is a simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once.
<?php // Simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once. ?>
<html>
<head>
<title>DNSBL Lookup Tool - IP Blacklist Check Script</title>
</head>
<body>
<h2>IP Blacklist Check Script</h2>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
<input type="text" value="" name="ip"/>
<input type="submit" value="LOOKUP"/>