Skip to content

Instantly share code, notes, and snippets.

View hamoid's full-sized avatar
🎨

Abe Pazos hamoid

🎨
View GitHub Profile
@hamoid
hamoid / curveWithVaryingColor.kt
Created March 25, 2023 22:07
OPENRNDR experimentation session with Alessandro and aBe, day 4, episode 5
// By Alessandro and aBe
// Saturday March 25th, 2023
// https://tubedu.org/c/in_conversations_collections/videos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.rgb
import org.openrndr.draw.*
import org.openrndr.extra.color.presets.BLANCHED_ALMOND
import org.openrndr.extra.noise.Random
@hamoid
hamoid / FixGradleDependencySources.kt
Created August 29, 2022 16:53
IntelliJ plugin code to add Gradle dependency sources for snapshot libraries. See https://youtrack.jetbrains.com/issue/IDEA-227215/
package com.hamoid.openrndrThumbnails.action
import com.hamoid.openrndrThumbnails.form.SettingsDialog
import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.WriteAction
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.roots.OrderRootType
import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar
@hamoid
hamoid / justTheDocsToPDF.bash
Last active January 24, 2024 13:14
Downloads a just-the-docs website and converts it into a PDF file for offline reading
#!/bin/bash
mkdir -p /tmp/manual
cd /tmp/manual
# curl downloads the index page of the website
# grep extracts the <nav> ... </nav> section
# sed(1) injects a line break in front of every URL and adds the full domain
# sed(2) deletes from each line the " character and everything that follows, leaving the clean URL
# tail deletes the first line, which contains a lonely <nav> tag
@hamoid
hamoid / intellijIdeaExternalToolReplace.kts
Created April 9, 2022 16:03
An example Kotlin script to process source code inside IntelliJ Idea
import java.io.File
// Process your selection inside IntelliJ Idea using a Kotlin script.
//
// 1. Install https://plugins.jetbrains.com/plugin/15539-external-tools-text-replace
// 2. Settings > Tools > External Tools > Create a new tool
// Set these values according to your system:
//
// Name: ?
// Description: ?
// Run in the js console while viewing a submission in HackerNews
// for example while visiting https://news.ycombinator.com/item?id=27799859
console.log('Users with more than 1 answer:')
var counts = {};
var arr = Object.values(document.getElementsByClassName('hnuser')).map(h => h.innerHTML);
arr.forEach(function (x) {
counts[x] = (counts[x] || 0) + 1;
});
var sorted = Object.entries(counts);
@hamoid
hamoid / workshop.md
Last active October 27, 2019 11:01
Links for In the Mood for Shaders workshop
@hamoid
hamoid / temp.csv
Created February 26, 2018 13:34
Temperature deviation 1880 - 2016
year temp
1880 -0.20
1881 -0.11
1882 -0.09
1883 -0.20
1884 -0.27
1885 -0.30
1886 -0.29
1887 -0.32
1888 -0.20
@hamoid
hamoid / download.js
Last active February 18, 2018 20:15
Download Berlin air pollution data from berlin.de
// launch with: node download.js
var http = require('http');
var fs = require('fs');
var start = new Date();
var end = new Date();
start.setDate(end.getDate() - 365);
var download = function() {
@hamoid
hamoid / generativeSpreadsheet.bas
Created October 23, 2017 14:34
Generative spreadsheet for LibreOffice
REM ***** BASIC *****
Sub Main
Dim Doc As Object
Dim Sheet As Object
Dim Cell As Object
Dim s As String
Doc = ThisComponent
Sheet = Doc.Sheets(0)
@hamoid
hamoid / processingOnTumblr.html
Last active July 4, 2016 11:27
Code that allows you to post and run Processing sketches on Tumblr
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
// processing.js loader
// by Abe Pazos - 23.01.2014 - http://funprogramming.org
// Updated - 04.07.2016
// 1. Install this script:
// A. Your Tumblr html template should include jquery. If missing, paste
// the first line above to load jquery. If jQuery is already available