Skip to content

Instantly share code, notes, and snippets.

View jacoby's full-sized avatar
🌮
I ❤️ Tacos

Dave Jacoby jacoby

🌮
I ❤️ Tacos
View GitHub Profile
@jacoby
jacoby / build.perl-5.30.0.log
Created October 16, 2019 20:05
How Perl fails to build on WSL
Auto-guessed '5.30.0'
Nothing to do '5.30.0' is fine
Beginning of configuration questions for perl5.
Checking echo to see how to suppress newlines...
...using \c
The star should be here-->*
First let's make sure your kit is complete. Checking...
@jacoby
jacoby / dropbox_copy.pl
Last active September 19, 2019 20:08
Download Dropbox directories to places where you don't have Dropbox
#!/home/djacoby/webserver/perl/bin/perl
# This program is used to download a Dropbox directory onto a machine
# without Dropbox tools installed
use strict;
use warnings;
use utf8;
use feature qw{ postderef say signatures state };
no warnings qw{ experimental::postderef experimental::signatures };
@jacoby
jacoby / ding
Created August 23, 2019 18:22
Perl program that plays a sound based on error condition
#!/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 July 7, 2019 23:25
Library to interface with Google's Geolocation, Geocoding and TimeZone APIs
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 20:15
list of four-letter dictionary words
10th
aaas
aahs
aani
aaru
abac
abas
abba
abbe
abbr
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 April 18, 2019 18:51
code and 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 April 18, 2019 17:32
Perl program (using EVERYTHING) to update your Twitter profile image (avatar)
#!/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 } ;
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.
$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};