Skip to content

Instantly share code, notes, and snippets.

Avatar
🗃️
Holding up libraries and robbing them blind for the future.

Don Fanning donfanning

🗃️
Holding up libraries and robbing them blind for the future.
View GitHub Profile
@donfanning
donfanning / PhonecallReceiver.java
Created Jan 27, 2022 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
View PhonecallReceiver.java
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@donfanning
donfanning / gist:baf5a2022b40e9d3c25afd7fb7c2aaa3
Created Jan 25, 2022
ZeroTier rename from dynamically generated to ZT0
View gist:baf5a2022b40e9d3c25afd7fb7c2aaa3
Zerotier reset interface name from ztxxxxxxx to zt0:
Step 1: create file /var/lib/zerotier-one/devicemap
Step 2: add a line `networkID=ifname`
example:
80xxxxxxxxxxx6d=zt0
Step 3: restart zerotier-one service
systemctl restart zerotier-one
View cite_xsede.bib
@inproceedings{ecss,
title = "An overview of the XSEDE extended collaborative support program",
abstract = "The Extreme Science and Engineering Discovery Environment (XSEDE) is a flagship cyberinfrastructure project funded by the US National Science Foundation (NSF). XSEDE’s Extended Collaborative Support Services (ECSS) program is a significant component of the XSEDE effort, dedicated to extended engagements with our user community which transform their research. We describe the organization, operation and some highlights of the program in this submission.",
author = "Nancy Wilkins-Diehr and Sergiu Sanielevici and Jay Alameda and John Cazes and Lonnie Crosby and Marlon Pierce and Ralph Roskies",
year = "2016",
month = "1",
day = "1",
doi = "10.1007/978-3-319-32243-8_1",
language = "English (US)",
isbn = "9783319322421",
@donfanning
donfanning / noiseloop.pde
Created Oct 19, 2020 — forked from golanlevin/noiseloop.pde
Processing code to demonstrate seamless loop of 1D noise
View noiseloop.pde
// Processing 3.0x code to demonstrate seamless loop of 1D noise
// Inspired by, and created in support of:
// "Drawing from noise, and then making animated loopy GIFs from there" by Etienne Jacob (@n_disorder)
// https://necessarydisorder.wordpress.com/2017/11/15/drawing-from-noise-and-then-making-animated-loopy-gifs-from-there/
// Note: this program has no dependencies, and does not require SimplexNoise.
// Demo GIF: https://media.giphy.com/media/xUOxeU2ELSPeTbevle/giphy.gif or http://gph.is/2Ah5kqG
PGraphics offscreenImg;
float myScale = 0.01;
float radius = 100.0;
View palmsynth.pde
// https://imgur.com/a/ZEE2f
final color wristCol = color(255, 0, 255);
final color palmCol = color(127);
final color thumbCol = color(0, 255, 0);
final color finger1Col = color(255, 0, 0);
final color finger2Col = color(0, 0, 255);
final color finger3Col = color(0, 255, 255);
final color finger4Col = color(255, 255, 0);
color fingerColors[] = {
@donfanning
donfanning / autocorrelation.pde
Created Oct 19, 2020 — forked from golanlevin/autocorrelation.pde
Autocorrelation demo in Processing
View autocorrelation.pde
float mysteryLag;
float signalA[];
float signalB[];
float autoCorr[];
int nData;
void setup() {
size(512, 700);
nData = 512;
@donfanning
donfanning / amos_cams_7800.csv
Created Oct 19, 2020 — forked from golanlevin/amos_cams_7800.csv
CSV List of 7800+ web cameras rescued from AMOS (Archive of Many Outdoor Scenes)
View amos_cams_7800.csv
We can't make this file beautiful and searchable because it's too large.
cameraid,name,url,latitude,longitude,last_width,last_height,mhash
1,VT,http://www.hazecam.net/images/main/burlington_right.jpg,44.478739,-73.19164,500,250,
2,Anthem school,http://wwc.instacam.com/instacamimg/PHNAS/PHNAS_l.jpg,33.2765,-112.1872,1280,720,
3,Coolidge High School,http://wwc.instacam.com/instacamimg/CLDGE/CLDGE_l.jpg,39.075880734474,-76.868118734,1280,720,
4,College of the Canyons,http://wwc.instacam.com/instacamimg/CLLCN/CLLCN_l.jpg,34.4044820734014,-118.569055939865,1280,1024,
5,Borrego Springs HS,http://wwc.instacam.com/instacamimg/BORYO/BORYO_l.jpg,33.2648176,-116.3834183,1280,720,
6,Potrero Hill,http://wwc.instacam.com/instacamimg/SANFR/SANFR_l.jpg,37.7603145925262,-122.422996428,1280,720,
7,City of Cripple Creek,http://wwc.instacam.com/instacamimg/CRPCK/CRPCK_l.jpg,38.8261,-105.1499,1280,720,
8,KOAA News First Cams,http://wwc.instacam.com/instacamimg/KOAAT/KOAAT_l.jpg,38.2886723,-104.6237902,1280,720,
9,Aspen ES/MS,http://wwc.instacam.com/instacamimg/ASPEN/ASPEN_l.jpg,0,0,640,480,
@donfanning
donfanning / amos_cams_7800.csv
Created Oct 19, 2020 — forked from golanlevin/amos_cams_7800.csv
CSV List of 7800+ web cameras rescued from AMOS (Archive of Many Outdoor Scenes)
View amos_cams_7800.csv
We can't make this file beautiful and searchable because it's too large.
cameraid,name,url,latitude,longitude,last_width,last_height,mhash
1,VT,http://www.hazecam.net/images/main/burlington_right.jpg,44.478739,-73.19164,500,250,
2,Anthem school,http://wwc.instacam.com/instacamimg/PHNAS/PHNAS_l.jpg,33.2765,-112.1872,1280,720,
3,Coolidge High School,http://wwc.instacam.com/instacamimg/CLDGE/CLDGE_l.jpg,39.075880734474,-76.868118734,1280,720,
4,College of the Canyons,http://wwc.instacam.com/instacamimg/CLLCN/CLLCN_l.jpg,34.4044820734014,-118.569055939865,1280,1024,
5,Borrego Springs HS,http://wwc.instacam.com/instacamimg/BORYO/BORYO_l.jpg,33.2648176,-116.3834183,1280,720,
6,Potrero Hill,http://wwc.instacam.com/instacamimg/SANFR/SANFR_l.jpg,37.7603145925262,-122.422996428,1280,720,
7,City of Cripple Creek,http://wwc.instacam.com/instacamimg/CRPCK/CRPCK_l.jpg,38.8261,-105.1499,1280,720,
8,KOAA News First Cams,http://wwc.instacam.com/instacamimg/KOAAT/KOAAT_l.jpg,38.2886723,-104.6237902,1280,720,
9,Aspen ES/MS,http://wwc.instacam.com/instacamimg/ASPEN/ASPEN_l.jpg,0,0,640,480,
View Bypassing needless CenturyLink Wireless Router on Gigabit Fiber.txt
View zyxel2graphite.py
#!/usr/bin/python
"""Copyright 2013 Bryan Irvine
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and