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 / vhx-asana-theme.css
Created July 15, 2012 18:03
A dark CSS theme for Asana
body {
background: #191919 !important;
font-family: Arial !important;
}
#project_header { background: #fff !important; }
#header {
background: #191919 url('http://vhx.tv/images/vhx-logo-crystal.png') 25px 60px no-repeat !important;
padding-top: 20px !important;
height: 120px;
@caseypugh
caseypugh / gist:6090895
Created July 26, 2013 18:01
Kickstarter suspicious money script
var total=0;$('#what-you-get li').each(function(i, el) {
var price = parseInt($(el).find('h5').html().match(/Pledge \$([0-9\,]+)/)[1].replace(',',''));
var backers = parseInt($(el).find('.num-backers').html());
total += price * backers;
});
console.log(total);
$('[data-pledged]').data('pledged') - total;
@caseypugh
caseypugh / easy-git.rdoc
Created June 18, 2012 15:51
GIT MADE EASY

Install jamiew’s git-friendly: github.com/jamiew/git-friendly

Some common shorthands I use - type these into your terminal

git config --global alias.st "status -s"
git config --global alias.ca "commit -a -m"

Checkout new repo

git clone git@github.com:vhx/watchlater
@caseypugh
caseypugh / gist:2380265
Created April 13, 2012 21:22
Rails Setup alpha
1. Install Homebrew (http://mxcl.github.com/homebrew/)
Homebrew makes the Terminal Life Easy™ by making it simple to install any sort of application. This is important mainly because it manages everything for you. For example, you can install mysql by just doing "brew install mysql". it does all the magic of setting it up and might give you some extra instructions after it's done. Uninstalling is just as easy - brew uninstall mysql. If you're looking for a specific app, you can do a search too: brew search ruby. There's also tons of stupid apps like "figlet" which allows you to generate custom ASCII art (http://www.figlet.org/ or brew install figlet)
2. Git (http://git-scm.com/download)
This should be pretty straight forward in terms of installing, but i have some tricks that can make Git much simpler than it is.
- .git/config
This is a hidden folder in all your git checkouts. In your terminal go to a git repo and type "mate .git/config". This will open git's config file which can be enlightening. You c
@caseypugh
caseypugh / vhx_hipchat.php
Created November 22, 2011 23:17
Send your VHX shares to HipChat
<?
///
// Sample usage:
// php vhx_hipchat.php staff myroom authtoken
//
// Screenshot: http://sht.tl/xeT
//
$vhx_user = $argv[1]; // staff