Skip to content

Instantly share code, notes, and snippets.

@brendandawes
brendandawes / Nothing Remains Allow List.csv
Last active August 11, 2022 05:38
Allow List for FXHash drop on 12/8/2022 at 4pm BST
Bezzo.tez 1
Corporatetrash.tez 1
Coughdrop.tez 1
ballislife.tez 1
cormac.tez 1
dominikus.tez 1
tz1Xu4PxeJccmvrXEtx8ybTC2HxndNxT4858 1
johnryan.tez 1
quasimondo.tez 1
raimans.tez 1
@brendandawes
brendandawes / BringWindowToFocus.pde
Created July 18, 2022 15:48
Processing:detect windows platform and bring window to have focus
// Useful for installations on windows which detect user interaction
if (platform == WINDOWS){
if (frameCount > 1000){
((java.awt.Canvas) surface.getNative()).requestFocus();
}
}
import http.requests.*;
void setup(){
size(640,640);
String txt = "The Quick Brown Fox Jumped Over the Lazy Dog";
JSONObject json = getJSONForText(txt);
PostRequest post = new PostRequest("https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2018-03-19");
post.addUser(USERNAME,PASSWORD);
post.addHeader("Content-Type", "application/json");
@brendandawes
brendandawes / seoul256-dawesome.vim
Last active May 21, 2018 08:17
Seoul256 Dawesome
" " _____ _ ___ ___ ___ "
" " | __|___ ___ _ _| |_ | _| _| "
" " |__ | -_| . | | | | _|_ | . | "
" " |_____|___|___|___|_|___|___|___|.vim "
"
" " Low-contrast dark Vim color scheme using Seoul Colors "
"
" File: seoul256.vim
" URL: github.com/junegunn/seoul256.vim
" Author: Junegunn Choi (junegunn.c@gmail.com)
/**
* Grid Maker for Notes to Myself
* http://producedforuse.com
* http://brendandawes.com
*/
import dawesometoolkit.*; //http://cloud.brendandawes.com/dawesometoolkit/
import processing.pdf.*;
import controlP5.*; //http://www.sojamo.de/libraries/controlP5/
@brendandawes
brendandawes / ifttt.php
Last active March 24, 2018 17:33
Script for use with IFTTT to automate making Kirby blog posts from Instagram
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/kirby/bootstrap.php');
// Path to a configuration file outside of a web accesible directory containing your secret pass phrase and salt.
include '/Path/To/Your/conf.inc';
if(get('id').$SALT==$IFTTT_PASS.$SALT) {
@brendandawes
brendandawes / .vimrc
Created February 3, 2018 13:54
.vimrc
set nocompatible " be iMproved, required
filetype off " required
set ignorecase
set autoindent
set cursorline
set noswapfile
set autoread
set t_Co=256
set number
set laststatus=2
@brendandawes
brendandawes / Processing Starting Template
Last active March 28, 2018 14:56
This is the boiler plate template I have setup each time I start a new Processing project. It includes my Dawesome Toolkit library as well as basic stuff for saving .png and .pdf files and exporting frames that you can compile into video. If you're a Vim user you can set this up to automatically be populated when you create a blank .pde file - t…
import dawesometoolkit.*;
import processing.pdf.*;
final String PROJECT = "project-x";
final int BACKGROUND_COLOR = #000000;
final int SECONDS_TO_CAPTURE = 60;
final int VIDEO_FRAME_RATE = 60;
int videoFramesCaptured = 0;
boolean recordVideo = false;
@brendandawes
brendandawes / Processing:videoexport
Created February 22, 2017 12:18
exporting frames for video
final int VIDEO_FRAME_RATE = 60;
final int SECONDS_TO_CAPTURE = 60;
int videoFramesCaptured = 0;
boolean recordVideo = false;
if (recordVideo){
saveFrame("export/####-video.tga");
if (videoFramesCaptured > VIDEO_FRAME_RATE * SECONDS_TO_CAPTURE){
recordVideo = false;
}
@brendandawes
brendandawes / processing:perspective
Created February 22, 2017 12:13
Better non clipping perspective in processing
float fov = PI/3;
float nearClip = 1;
float farClip = 100000;
float aspect;
// void setup()
aspect = float(width)/float(height);
// void draw()