Skip to content

Instantly share code, notes, and snippets.

🌮
I ❤️ Tacos

Dave Jacoby jacoby

🌮
I ❤️ Tacos
Block or report user

Report or block jacoby

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jacoby
jacoby / ding
Created Aug 23, 2019
Perl program that plays a sound based on error condition
View ding
#!/usr/bin/env perl
# tool to tell you when a long-running process is over
# usage:
# ding.pl cp -r ~/bigdir ~/otherdir
use feature qw{ say state } ;
use strict ;
use warnings ;
@jacoby
jacoby / GoogleGeo.pm
Created Jul 7, 2019
Library to interface with Google's Geolocation, Geocoding and TimeZone APIs
View GoogleGeo.pm
package GoogleGeo;
# interfaces with Google Geolcation API
# https://developers.google.com/maps/documentation/geolocation/intro
use strict;
use warnings;
use utf8;
use feature qw{ postderef say signatures state };
@jacoby
jacoby / four_letter_words.txt
Created May 6, 2019
list of four-letter dictionary words
View four_letter_words.txt
10th
aaas
aahs
aani
aaru
abac
abas
abba
abbe
abbr
View magic_box.rs
fn main() {
let mut this_is_mutable_motherfucker: [i32; 9] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
for i in 3..12 {
if i == i {
this_is_mutable_motherfucker[0] = i;
for j in 3..12 {
if j == j && j != i {
this_is_mutable_motherfucker[1] = j;
@jacoby
jacoby / error
Created Apr 18, 2019
code and error
View error
Compiling yafpl v0.1.0 (/home/jacoby/local/dev/rusty_world/yafpl)
error[E0308]: mismatched types
--> src/main.rs:29:32
|
29 | recurse_magic_box(&numbers,&this_is_mutable_motherfucker,0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type `&mut [i32]`
found type `&[i32; 9]`
@jacoby
jacoby / twitter_update_profile_image.pl
Created Apr 18, 2019
Perl program (using EVERYTHING) to update your Twitter profile image (avatar)
View twitter_update_profile_image.pl
#!/usr/bin/env perl
use feature qw{ say } ;
use strict ;
use utf8 ;
use Carp ;
use Data::Dumper ;
use Encode qw{decode decode_utf8} ;
use Getopt::Long ;
use IO::Interactive qw{ interactive } ;
View gist:764bb4e8a5d3a819b5fbfa497fcb3454
Let's start with octal. That's base8.
You'd count it 0,1,2,3,4,5,6,7,10,11,12...
There's only the digits 0 thru 7 , and when you get to 8, that's 10.
So, if you have 12 in octal, that's (1*8) + 2, which is 10 in decimal.
And, 100 in octal would be 1*(8 squared), or 64 decimal.
View mysolution.pl
$obj->{output}{plate}->@* =
map { delete $_->{pi} if $_->{pi} eq ''; $_ }
sort { $a->{i7} cmp $b->{i7} }
sort { $a->{i5} cmp $b->{i5} }
sort { $a->{pi} cmp $b->{pi} }
grep {
state $hash = {};
my $obj;
$obj->{pi} = $_->{pi} if $_->{pi};
@jacoby
jacoby / GoogleGeo.pm
Last active Oct 27, 2018
My Google API-interfacing code
View GoogleGeo.pm
package GoogleGeo;
# interfaces with Google Geolcation API
# https://developers.google.com/maps/documentation/geolocation/intro
use strict;
use warnings;
use utf8;
use feature qw{ postderef say signatures state };
@jacoby
jacoby / match
Created Aug 31, 2018
command line program that takes a regex and return what it matches
View match
#!/usr/bin/env perl
use strict ;
use warnings ;
use utf8 ;
use feature qw{ postderef say signatures state } ;
no warnings qw{ experimental::postderef experimental::signatures } ;
use Getopt::Long ;
You can’t perform that action at this time.