Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile
@aculich
aculich / using-details-summary-github.md
Created December 7, 2022 20:36 — forked from scmx/using-details-summary-github.md
Using <details> <summary> expandable content on GitHub with Markdown #details #summary #markdown #gfm #html

How to use <details> <summary> expandable content on GitHub with Markdown

Firstly, what is <details> <summary>?

The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.

Example

@aculich
aculich / homebrew-gnubin.md
Created November 28, 2022 19:42 — forked from skyzyx/homebrew-gnubin.md
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@aculich
aculich / android_instructions.md
Created September 23, 2022 01:17 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@aculich
aculich / when2meet-subset.js
Created September 22, 2022 09:53 — forked from edemaine/when2meet-subset.js
Enable toggling subset of users in when2meet results view
// paste this into your browser console when looking at when2meet results
if (!window.OrigAvailableAtSlot) window.OrigAvailableAtSlot = AvailableAtSlot;
if (!window.OrigAvailableIDs) window.OrigAvailableIDs = AvailableIDs;
let nameFilter;
if (nameFilter = document.getElementById('NameFilter')) nameFilter.remove();
nameFilter = document.createElement('ul');
nameFilter.id = 'NameFilter';
document.getElementById('LeftPanel').appendChild(nameFilter);
const idOn = (id) => document.getElementById(id).checked;
for (let i = 0; i < PeopleNames.length; i++) {
@aculich
aculich / base32.js
Created September 18, 2022 15:35 — forked from kiasaki/base32.js
Base32 encode/decode in Javascript
// From https://technote.fyi/code/javascript/base32-encoding-and-decoding-in-javascript/
(function(exports) {
var base32 = {
a: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
pad: "=",
encode: function (s) {
var a = this.a;
var pad = this.pad;
var len = s.length;
var o = "";
@aculich
aculich / export_when2meet.js
Last active March 13, 2024 09:22 — forked from camtheman256/export_when2meet.js
Export when2meet data from JS console
function getCSV() {
result = "Time," + PeopleNames.join(",")+"\n";
for(let i = 0; i < AvailableAtSlot.length; i++) {
let slot = $x(`string(//div[@id="GroupTime${TimeOfSlot[i]}"]/@onmouseover)`);
slot = slot.match(/.*"(.*)".*/)[1];
result += slot + ",";
result += PeopleIDs.map(id => AvailableAtSlot[i].includes(id) ? 1 : 0).join(",");
result+= "\n";
}
console.log(result);
@aculich
aculich / tweet_dumper.py
Last active June 13, 2022 18:32 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
#!/usr/bin/env python
# encoding: utf-8
### Upstream code: https://gist.github.com/yanofsky/5436496#file-tweet_dumper-py
### Upstream LICENSE: https://gist.github.com/yanofsky/5436496#file-license
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
@aculich
aculich / Code.gs
Created May 25, 2022 02:31 — forked from rheajt/Code.gs
function doGet(e) {
if(!e.parameters.sheetId) {
return HtmlService.createTemplateFromFile('Start').evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME);
} else {
var html = HtmlService.createTemplateFromFile('Viewer');
//set variable of sheet id to post in hidden input field for async request when page loads
html.sheetName = SpreadsheetApp.openById(e.parameters.sheetId).getName();
html.sheetId = e.parameters.sheetId;
@aculich
aculich / simple-hash.js
Created May 15, 2022 20:38 — forked from jlevy/simple-hash.js
Fast and simple insecure string hash for JavaScript
// This is a simple, *insecure* hash that's short, fast, and has no dependencies.
// For algorithmic use, where security isn't needed, it's way simpler than sha1 (and all its deps)
// or similar, and with a short, clean (base 36 alphanumeric) result.
// Loosely based on the Java version; see
// https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript
const simpleHash = str => {
let hash = 0;
for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i);
hash = (hash << 5) - hash + char;
@aculich
aculich / tellmeyoursecrets.js
Created April 20, 2022 11:58 — forked from woodwardtw/tellmeyoursecrets.js
google script that lists a lot of info about the files in a particular folder/sub folder structure including viewers, editors, and sharing permissions
function listFolders(folder) {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow(["Name", "Sharing Access", "Sharing Permission", "Get Editors", "Get Viewers", "Date", "Size", "URL", "Download", "Description", "Type"]); //writes the headers
var folder = DriveApp.getFolderById("YOUR_FOLDER_ID");//that long chunk of random numbers/letters in the URL when you navigate to the folder
var files = folder.getFiles();//initial loop on loose files w/in the folder
var cnt = 0;
var file;