Skip to content

Instantly share code, notes, and snippets.

View davehorner's full-sized avatar

David Horner davehorner

View GitHub Profile
@pjlsergeant
pjlsergeant / git.pl
Created November 27, 2012 12:42
GraphViz Git Commit Tree
#!perl
# Draw the commit graph of a git repository, using GraphViz. Supply the directory
# the repo is in as the first argument. Writes a file called 'repo.svg' to the CWD.
use strict; use warnings;
use Cwd;
use Git::PurePerl;
use GraphViz2;
@pjlsergeant
pjlsergeant / gist:6255791
Created August 17, 2013 07:51
Count new Pause IDs
#!perl
use strict;
use warnings;
use LWP::Simple;
use DateTime;
use Data::Google::Visualization::DataTable;
# Create a datatable
#!/usr/bin/env perl
use Mojolicious::Lite;
use DBIx::Connector;
use SQL::Abstract;
helper db => sub {
state $db = DBIx::Connector->connect("dbi:mysql:host=localhost;db=testdb", 'testuser', 'xxxsecret')
};
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@jshy
jshy / dozer.pl
Created May 10, 2014 02:56
MongoDB REST Interface in Perl (Mojolicious)
#!/usr/bin/env perl
use Mojolicious::Lite;
use MongoDB;
use MongoDB::OID;
my $mongo_port = shift || 27017;
helper 'mongo' => sub {
my ($self, $name) = @_;
my $host = 'localhost:' . $mongo_port;
@Zehkul
Zehkul / Convert Script – README.md
Last active December 16, 2023 07:19
Script to quickly convert and crop videos from within mpv

#README:

This script for mpv intends to offer the fastest and simplest way to convert parts of a video—while you’re watching it and not really more work intensive than making a screenshot. A short demonstration: https://d.maxfile.ro/omdwzyhkoa.webm

##Installation:

You need:

  • yad (at least 0.26) (AUR)
@reneeb
reneeb / get_fail_reports.pl
Created May 29, 2014 16:41
get_fail_reports
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use IO::File;
use Mojo::UserAgent;
use XML::RSS::Parser::Lite;
from fedora
maintainer Mark Allen <mrallen1@yahoo.com>
run yum -y install perl-Mojolicious
run yum -y cpanminus
run cpanm Games::Dice
run yum install -y git
run git clone https://gist.github.com/mrallen1/44a415c302139af78dde
cmd ["morbo", "44a415c302139af78dde/dice.pl", "&"]
expose 3000
@nanis
nanis / imgxform.pl
Created July 11, 2014 00:22
Fun with image transformations in Perl: American Gothic in the palette of Mona Lisa: Rearrange the pixels
#!/usr/bin/env perl
use 5.020; # just because
use strict;
use warnings;
use Const::Fast;
use GD;
GD::Image->trueColor(1);
@cswiercz
cswiercz / simple.py
Last active May 14, 2023 01:07
A quick demonstration of how to plot multivalued complex functions in Python.
import numpy
import sympy
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
from matplotlib import cm, colors
from matplotlib import pyplot as plt
branching_number = 2