Skip to content

Instantly share code, notes, and snippets.

View davidmerrick's full-sized avatar

David Merrick davidmerrick

View GitHub Profile
@martinwoodward
martinwoodward / mermaid.md
Created February 11, 2022 20:34
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe->>dotcom: iframe ready
// ----------------------------------------------------------------------------
// 🚨 STEP 1. 🚨
// Change 'Test' to the name of your table.
let table = base.getTable('Test');
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// 🚨 STEP 2: 🚨
// Change the following url to your Zapier webhook.
// To get a Zapier webhook, click the below link, then choose "Catch Hook" as the trigger event
@victorlin
victorlin / create_dated_folders.sh
Last active October 19, 2022 23:35
shell scripts to organize and modify scanned images from Epson FastFoto FF-680W
for f in *.jpg; do
date="${f:0:10}"
if ! [ -d "${date}" ]; then
echo "creating folder ${date}"
mkdir "${date}"
fi
echo "moving ${f}"
mv ${f} ${date}
done
@jcassee
jcassee / ScopeSecured.java
Created May 23, 2020 22:12
Implementation of Micronaut Security annotation for securing routes using JWT scopes (micronaut-projects/micronaut-security#254)
package example;
import java.lang.annotation.*;
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface ScopeSecured {
String[] value();
@nbonfire
nbonfire / mysubaru.py
Created May 20, 2019 15:49
MySubaru python samples
import requests, json
from subarucreds import username,password,pin # just a "subarucreds.py" that has some variables i didn't want to share
import datetime
#login
s=requests.Session()
loginr=s.post('https://www.mysubaru.com/login', data = {'username':username,'password':password})
#should return a response 200
#Where's my subaru?
@Phoenix-Effect
Phoenix-Effect / googlebooks_to_airtable.py
Created July 17, 2018 23:20
Pulls ISBN numbers/titles from an airtable and then download's the book information from google books and reuploads to airtable.
import os
import re
from airtable import Airtable
from airtable.auth import AirtableAuth
import requests
import pprint
from pathlib import Path
APIKEY = "ENTER THIS"
BASEURL = "ENTER THIS"
@blazs
blazs / Earley.java
Created January 13, 2018 18:10
An old Java implementation of the Earley parser from student days.
// -- Description --
// Assume 'S' is always the start symbol
// You may assume that your method will be tested in the following setting:
// - grammar will contain between 1 and 100 strings,
// - each string will represent one production (possibly with multiple right
// hand sides, separated by | (see examples)),
// - word can be empty or up to 10000 terminal symbols (characters) long.
// -- References --
// [1] Jay Earley. An Efficient Context-Free Parsing Algorithm. Communications of the ACM, 1970.
// [2] John Aycock and Nigel Horspool. Practical Earley Parsing. Computer Journal, 2002.
@Ambroos
Ambroos / WARNING.md
Last active November 30, 2023 06:20
Remove SentinelOne agent from Mac. Because honestly, it doesn't seem to do anything at all. Run as root, best is to do this from a recovery mode, single user mode with writeable filesystem, ...

USE AT OWN RISK

This was only tested on a 'partial' SentinelOne installation on the High Sierra beta, where SentinelOne was never allowed to enable it's kernel extension. (Some things failed while I was messing around with OS betas.)

This script is most likely outdated.

A lot happens in 2+ years, at this point there's a good chance this script will do more harm than good. Read the comments before using!

Got Retweets?

Even though Twitter's statuses/retweets API endpoint is limited to the last 100 retweets it is possible to use the search/tweets endpoint to search for the retweets using the text of the tweet. Caveat: This is only possible for tweets that have happened in the last 7 days, which is furthest back Twitter allow you to search for tweets in.

For example here is how you can get the retweets for this tweet and analyze the users in a spreadsheet.

@danihodovic
danihodovic / main.tf
Created January 8, 2017 20:48
Terraform - static site using S3, Cloudfront and Route53
variable "aws_region" {
default = "eu-west-1"
}
variable "domain" {
default = "my_domain"
}
provider "aws" {
region = "${var.aws_region}"