Skip to content

Instantly share code, notes, and snippets.

View zmughal's full-sized avatar
🌿
fiddling with attribute grammars.

Zaki Mughal [sivoais] zmughal

🌿
fiddling with attribute grammars.
View GitHub Profile
#!/usr/bin/env bash
# See <http://perltricks.com/article/57/2014/1/1/Shazam-Use-Image-Magick-with-Perlbrew-in-minutes>
# may need to have the perl configured with -Duseshrplib
#
# perl -V | grep -- '-Duseshrplib'
# compile perl with perlbrew:
#
#!/bin/sh
perl -Mojo -E 'b($ENV{PATH})->split(":")->join("\n")->say'
#!/bin/sh
export LC_CTYPE="C" TZ="America/Los_Angeles"
DATE=`date '+%B %d'`
STREAK=`perl -Mojo -E 'say g("http://github.com/zmughal")->dom->find("div.contrib-streak-current")->[0]->all_text(0) =~ s,^\s*,,mgsr =~ s,\s*\n, ,mgsr'`
STREAK_TODAY="$DATE Current Streak\s*$"
echo $STREAK
if echo "$STREAK" | grep -q "$STREAK_TODAY"; then
echo "We're good"
else
#!/usr/bin/env perl
use strict;
use warnings;
use PDL;
use DDP;
my $d = sequence(4,5);
my $xv = sequence(10)+4;
my $bin_assignments = abs($d - $xv->dummy(2,1)->mv(0,2))->mv(2,0)->minimum_ind;
From caff15a7196f8428ea2dce8d2d81b61a1ede3b26 Mon Sep 17 00:00:00 2001
Date: Fri, 18 Apr 2014 21:18:06 -0500
Subject: [PATCH] fix pkg-config
---
lept.pc.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lept.pc.in b/lept.pc.in
index 8044ba8..c1b9492 100644
$WriteMakefileArgs{CONFIGURE} = sub {
require Alien::Leptonica;
my $l = Alien::Leptonica->new;
my $pkg = ExtUtils::Depends->new('Image::Leptonica',);
$pkg->set_inc( $l->cflags );
$pkg->set_libs( $l->libs );
$pkg->add_typemaps( 'typemap' );
mkdir catfile qw( lib Image Leptonica )
$pkg->save_config('Image/Leptonica/IFiles.pm');
<?php
$apiUrl = "https://www.googleapis.com/civicinfo/us_v1/representatives/lookup?fields=officials&key=AIzaSyARokMXd73Cj3k0rXRFh-s689q_uprujTY";
// $json_url = $apiUrl;
//
// $json = file_get_contents($json_url);
//
// $data = json_decode($json,true);
//
package Method::Generate::Constructor::Role::HandlesAccessor;
use strict;
use warnings;
use Moo::Role;
use B ();
around _assign_new => sub {
my $orig = shift;
my $self = shift;
package MooXHandlesViaConstructor;
use strict;
use warnings;
use Moo::Role;
use MooseX::MungeHas ();
use Import::Into;
use Class::Method::Modifiers qw(install_modifier);
sub import {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.