Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active April 27, 2024 09:00
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@aaggour
aaggour / formaction attribute
Created July 30, 2019 16:47
formaction attribute
<form action="http://example.com">
<input type=submit value=Submit ↵
formaction="http://www.wufoo.com">
</form>
@cmungall
cmungall / make_gdrive_index.py
Created June 12, 2019 01:46
Generate HTML index of a synced google drive folder. For me this is faster to search and navigate than the clunky slow google web interface. Pretty hacky code but it works for me
#!/usr/bin/env python3
import os
import re
import logging
import click
# don't index these
excludes = {
'single_files',
'Icon',
@dannguyen
dannguyen / aws-textract-sample-readme.md
Last active October 30, 2023 05:49
A gist of AWS Textract sample/demo data for easy reference and preview, in case you're curious how well Amazon does when it comes to pdf-to-csv

AWS Textract -- sample document image and data from the offical demo

AWS Textract is now out of closed beta. You can read the features page here, and you can also read about its limits here (e.g. no handwriting). Basically, if you've ever had to deal with the hell of getting structured data out of a PDF (scanned image or not), Textract is aiming for your business:

image

This short gist contains some of my brief observations about Textract and its demo, as well as direct links to the most relevant and important files, such as the Textract demo sample image and the resulting data files from Textract's API. If you have an AWS account, I h

/*
* Do not remove the @namespace line -- it's required for correct functioning
*/
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
/*
Disable tab throbber to stop battery death.
https://bugzilla.mozilla.org/show_bug.cgi?id=1422090#c67
*/
<html>
<head>
<title>Deckgl RGB PointCloud + Mapbox</title>
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js"></script>
<link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css">
<style>
body {
background-color: #000000;
margin: 0;
@mhawksey
mhawksey / code.gs
Created April 26, 2019 18:37
Example Google Apps Script custom sheet function example. For more info see https://mashe.hawksey.info?p=19219
/**
* Generates a SHA-256 hash of a text input.
*
* @param {String||Array} value to SHA-256 hash.
* @param {String} key to use to generate the hash with.
* @return the SHA-256 hash of the value
* @customfunction
*/
function HASH(value, key) {
if (typeof key !== 'string'){ // test the key is a string
@kgjenkins
kgjenkins / readme.md
Last active April 28, 2020 18:45
Geocoding in Google Sheets

Geocoding in Google Sheets

The NYS GIS Program Office geocoding service can geocode structured addresses (with street number, city, zipcode, etc. in different fields) as well as freeform addresses (with everything in a single field).

This geocoder is available as an ArcGIS REST GeocodeServer, which is great if you are using Esri software, but what if you are not? Below, we'll see how to use the geocoder within Google Sheets, for an easy way to geocode addresses across New York State, without having to use any special software.

Understanding the GeocodeServer request URL

Calls to an ArcGIS GeocodeServer can be written in the form of a URL with parameters for the input address and output settings. Here is an example, broken into separate lines for readability:

@LarrySul
LarrySul / Final code to send mail by @DevLarry
Last active April 3, 2021 15:24
Configure and set up PHPMailer to send mails
<?php
// use the phpmailer we installed via composer
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
require 'vendor/phpmailer/phpmailer/src/Exception.php';
require 'vendor/phpmailer/phpmailer/src/PHPMailer.php';
require 'vendor/phpmailer/phpmailer/src/SMTP.php';
if (array_key_exists('to', $_POST)) {