Skip to content

Instantly share code, notes, and snippets.

View mbutler's full-sized avatar
🇦🇶
Exploring

Matthew Butler mbutler

🇦🇶
Exploring
View GitHub Profile
@codediodeio
codediodeio / database.rules.json
Last active November 4, 2024 03:22
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active November 9, 2024 12:16
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbutler
mbutler / omeka.sql
Last active February 10, 2021 03:41
omeka snippets
/* grab all files of item */
SELECT `id` FROM `omeka`.`files` WHERE `item_id` LIKE '4342';
/* count the files in an item */
SELECT COUNT(*) FROM `omeka`.`files` WHERE `item_id` LIKE '4342';
/* get the record_id of a file by id */
SELECT `record_id` FROM `omeka`.`element_texts` WHERE `id` = 126560;
/* create tags automatically from dc metadata fields. In this case ‘Audience’ (id 124) */
@mbutler
mbutler / cthulhu.txt
Last active August 17, 2024 22:31
install log
9.04 2009-NOV-06
10.04 LTS 2012-FEB-03
kernel 3.5.2 2012-OCT-10
12.04.1 LTS on 2012-OCT-19
14.04.1 LTS on 2014-OCT-25
kernel 3.15.4-x86_64 2014-OCT-25
16.04.2 LTS on 2017-MAR-08
18.04.3 LTS on 2019-SEP-22
[DO NOT UPGRADE! Ubuntu 18.04 is last supported version for i386. Broken and restored from backup on 2024-MAR-13.]
@woodwardtw
woodwardtw / listfiles_google_drive.js
Last active June 8, 2022 14:52
google script to list all subfolder content of a particular folder
function listFolders(folder) {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow(["Name", "Folder", "Date", "Size", "URL", "Download", "Description", "Type"]);
var folder = DriveApp.getFolderById("0BxGcFSIReuGfOTJ0dTloY2xWS0E");
var subfolders = folder.getFolders();
while (subfolders.hasNext()) {
//Logger.log(folder);
@postmodern
postmodern / comment.md
Last active January 11, 2024 15:37
Crypto Privacy Copy Pasta
@jeremyboggs
jeremyboggs / Custom Random Featured Items helper.php
Created January 26, 2011 19:35
A helper function for Omeka to retrieve any number of random featured items. Include this function in your Omeka theme's custom.php file, and use wherever you'd like to get some random featur
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough [email protected]
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/