Skip to content

Instantly share code, notes, and snippets.

View zachwhalen's full-sized avatar
🥗

Zach Whalen zachwhalen

🥗
View GitHub Profile
@zachwhalen
zachwhalen / botcode.pl
Created February 28, 2014 22:57
This is a slightly cleaned up version of the code that runs @rom_txt. It's pretty simple -- it just loads a big text file and picks a random few lines.
#/usr/bin/local/perl
use Net::Twitter;
use Data::Dumper;
use LWP::Simple;
# get API credentials at http://dev.twitter.com
my $nt = Net::Twitter->new(
traits => [qw/API::RESTv1_1/],
@zachwhalen
zachwhalen / Question.md
Created March 5, 2014 21:34
A question

Hello,

I have inquiry that is too long to tweet, too technical for facebook, and I wouldn't know who to email it to. So I'm posting it here as a gist in the hope that it can reach someone who might have an answer or suggestion to the problem I'm trying to solve.

The problem is this: I have a Google Apps script scraping for content to add to amillionbluepages.net. I'd like for it to tweet whenever it finds and ingests something new, but I don't know how to make that work reliably.

For now, and this isn't working, I compose a tweet text in the script, append that text as a cell on a google spreadsheet, and then I have an If This Then That recipe checking the RSS feed generated by that spreadsheet. The problem is, IFTTT can't always read those new cells because Google Spreadsheets doesn't output consistent or valid RSS. I'm not sure what's going on there.

The other option I know of would seem to be easier: send tweets directly from the Google Apps script. That would be great, except for a Google Apps bug th

@zachwhalen
zachwhalen / gist:36ff9caade7294606079
Created September 16, 2014 14:40
basicallytopgun.pl
#!/usr/bin/local/perl
use Net::Twitter;
$prefix = '/home/zach/Software/pg/power';
# make a list of all the frames
@frames = glob "$prefix/frames/*.png";
# select the first one from that list, to be tweeted.
#!/usr/bin/local/perl
# a quick and dirty numeric syllable counter
use Number::Spell;
@one = qw/one two three four five six eight nine ten twelve/;
@two = qw/seven thirteen fourteen fifteen sixteen eighteen nineteen twenty thirty forty fifty sixty eighty ninety hundred thousand million billion trillion/;
@three = qw/eleven seventeen seventy/;
#!/usr/bin/local/perl
for ($i = 0; $i < 10000; $i++){
$convert = `convert zen-jpg.jpg -resize 50% -quality 50 zen-jpg.jpg`;
$convert = `convert zen-jpg.jpg -resize 200% -quality 50 zen-jpg.jpg`;
}
@zachwhalen
zachwhalen / out.pl
Last active August 29, 2015 14:26
Work in progress code for generating all possible panel layouts
#!/usr/bin/local/perl
#use experimental 'smartmatch';
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
# Can I do this with 2x4?
# ##
# ##
# ##
# ##
@zachwhalen
zachwhalen / gist:7508906
Last active December 28, 2015 13:39
The core combat code for the MaryWashemon battle function
// left attacks right
// this is from patrick's code
// the 10 value below acts as the gas peddle
var modifier = Math.floor((Math.random() * ((left.attack - right.defense) + 10)));
var rightDamage = modifier * left.lvl + 1;
// right takes damage
right.hp -= rightDamage;

House of Leaves is a challenging novel. Its complex metatextuality seems to present multiple targets for scholarly critique and exegesis, just as its overwrought erudition anticipates and satirizes any attempt at analysis. Moreover, it is a novel informed and constituted by its network, both the pre-existing network of cultural, literary, and philosophical references that populate the text as well as the post-publication network of critical fandom that emerged around the official forum for the book. As Jessica Pressman has argued, House of Leaves is a networked novel, so this assignment invites you to participate in a unique experiment in re-networking House of Leaves, through a collaboration with students at four other institutions (Temple, Emory, George Mason and Converse). 

As a group, we will be reading throug

ideas of

  • forum again meh

  • mapping

  • wiki

  • annotation

  • digital humanities

@zachwhalen
zachwhalen / nn.sh
Last active June 2, 2018 16:47
A bash script to create and open a new text file with the appropriate header for a blog post in a Pico site.
nn() {
# the header template
ft="---
Title: Untitled Note
Template: blog-post
Description: New Note
Date: $(date)
Tags:
---";