Skip to content

Instantly share code, notes, and snippets.

View caseypugh's full-sized avatar
🤡
🤡🤡🤡🤡🤡🤡🤡🤡🤡

CPU caseypugh

🤡
🤡🤡🤡🤡🤡🤡🤡🤡🤡
View GitHub Profile
@caseypugh
caseypugh / refresh-blockchain.sh
Last active March 4, 2021 18:01
Free up space on your DIY helium hotspot
#!/bin/bash
# Download this script to your computer and upload it to your hotspot using scp
# scp /Path/to/refresh-blockchain.sh hotspot_ssh_address:/home/pi
#
# SSH into hotspot, and edit your crontab (sudo crontab -e) and add this:
# 0 8 * * * /home/pi/refresh-blockchain.sh >> /home/pi/refresh-blockchain.log 2>&1
DATA_PATH=/home/pi/miner_data
DATA_BACKUP_PATH=/home/pi/miner_data_bak
@caseypugh
caseypugh / NewEntry.cs
Last active October 1, 2020 16:35
Create unique IDs and timestamps for new Google Sheet entries
function onEdit(event)
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var actSht = event.source.getActiveSheet();
var actRng = event.source.getActiveRange();
var curRowIndex = actRng.getRowIndex();
var date = Utilities.formatDate(new Date(), "GMT-4", "MM/dd/yyyy HH:mm:ss");
// Find column names
@caseypugh
caseypugh / MediaPlayer.cs
Last active September 18, 2018 19:11
Snippet from AVPro Movie Capture
#define AVPROVIDEO_BETA_SUPPORT_TIMESCALE // BETA FEATURE: comment this in if you want to support frame stepping based on changes in Time.timeScale or Time.captureFramerate
@caseypugh
caseypugh / TinyPlanetCam.cs
Last active August 1, 2018 15:22
Simple script to animate a Unity and synchronize to video playback.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vimeo.Player;
public class TinyPlanetCam : MonoBehaviour {
[Range(1f, 100f)]
public float fovAmplitude = 1f;
@caseypugh
caseypugh / SyncRecorderAndPlayer.cs
Last active July 31, 2018 16:56
How to synchronize playback and recording with the Vimeo Unity SDK.
using UnityEngine;
using Vimeo.Recorder;
using Vimeo.Player;
using System.Collections;
namespace Vimeo.Recorder
{
public class SyncRecorderAndPlayer : MonoBehaviour {
private VimeoRecorder recorder;
public VimeoPlayer vimeoPlayer;
@caseypugh
caseypugh / gist:e4112988dc012ecaaa20
Created April 12, 2015 19:17
save display state of a series
$(function () {
var visible = getCookie('HCseriesVisible');
console.log(visible);
function saveSeriesState(cvalue) {
var d = new Date();
d.setTime(d.getTime() + (365*24*60*60*1000)); // 1 year coockie
var expires = "expires="+d.toUTCString();
document.cookie = "HCseriesVisible=" + cvalue + "; " + expires;
}
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
jQuery.noConflict();
setTimeout(function() {
(function($){$.extend({tablesorter:new
function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);
@caseypugh
caseypugh / android-emulation.md
Last active August 29, 2015 14:12
How to setup Android emulation

Install the Android SDK through Homebrew:

brew update && brew install android-sdk

Add the $ANDROID_SDK_ROOT to your shell. By default OS X uses bash. r24.0.1 is the latest version at the time of writing this. This might differ for you. Check brew’s installation output. It has the correct export line in it.

The following command should take care of it:

@caseypugh
caseypugh / package.js
Created August 25, 2014 22:32
Package scrolling bg select
var total_height = 2000
var container_height = 300
var package_height = 35
var container_ypos = 0 // starting at top
// value between 0 and 1
var scrollbar_pos = container_ypos / (total_height - container_height)
var selected_package = Math.floor(container_ypos + (container_height * scrollbar_pos)) / package_height)
@caseypugh
caseypugh / desperation.txt
Created August 2, 2014 15:48
Messages from desperate people
LOL
ASSHOLES
SAGAR IS DRUNK.. HOLLERING AT ANY SINGLE LADIES
HI THIS IS MATT SUTER. CAN YOU BUZZ ME IN? TKS!
HI!