Skip to content

Instantly share code, notes, and snippets.

View Hiranyaloka's full-sized avatar

Rick Bychowski Hiranyaloka

View GitHub Profile

Keybase proof

I hereby claim:

  • I am hiranyaloka on github.
  • I am rickbike (https://keybase.io/rickbike) on keybase.
  • I have a public key ASCzVFKKTGECblgWxQQJaBBVMElvEmAIIys5uzkZ3es3Hwo

To claim this, I am signing this object:

@Hiranyaloka
Hiranyaloka / pwned.pl
Created June 4, 2019 07:37
Perl script to check passwords against pwnedpasswords.com api.
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw/say/;
use Digest::SHA 'sha1_hex';
use LWP::UserAgent;
my $ua = 'pwned.pl';
my $timeout = 5;
my $base_url = 'https://api.pwnedpasswords.com/range/';
[%- IF c.user_exists %]
You are logged in as <a href="[% c.uri_for( '/user' ) %]">[% ( c.user.display_name || c.user.username ) | html %]</a>. <a href="[% c.uri_for( '/user', 'edit' ) %]">Click here</a> to edit your profile, or here to <a href="[% c.uri_for( '/user', 'logout' ) %]">logout</a>.
[%- ELSE %]
<a href="[% c.uri_for( '/user', 'login' ) %]">Login</a>
[%- IF c.controller('User').allow_registration.upper == 'YES' -%]
or <a href="[% c.uri_for( '/user', 'register' ) %]">register an account.</a>
[%- END -%]
[%- END %]
@Hiranyaloka
Hiranyaloka / shiny-slideshow.tt
Created April 11, 2015 01:34
ShinyCMS Slideshow with JShowOff
[% slideshow = [
[ elements.image1, elements.caption1 ],
[ elements.image2, elements.caption2 ],
[ elements.image3, elements.caption3 ],
[ elements.image4, elements.caption4 ],
[ elements.image5, elements.caption5 ],
[ elements.image6, elements.caption6 ]
]
%]
<div id="impact">
@Hiranyaloka
Hiranyaloka / pm-list
Created March 10, 2012 02:40
list all installed perl modules.
#!/bin/sh
# From http://blog.kiftwi.net/2011/08/02/os-x-lionにperlbrewとcpanmをインストールしてperl環境を整える/
cat `perldoc -l perllocal` | perl -nle '/C<Module> L<([^\|]*?)\|.*?>/ and print "$1"' | sort -u
@Hiranyaloka
Hiranyaloka / Document Listing widget
Created September 7, 2011 07:01
This code should produce a list of assets associated with an entry or page.
<div class="sidebar-documents widget">
<mt:EntryAssets>
<mt:If name="__first__">
<div class="widget-content">
<h3>Document<mt:If name="sidebar_asset_count" gt="1">s</mt:If></h3>
<ul>
</mt:If>
<mt:Var name="sidebar_asset_count" op="++" setvar="sidebar_asset_count">
<li><a href="<$mt:AssetURL$>" title="<mt:If tag="AssetDescription"><$mt:AssetDescription$></mt:If>"><$mt:AssetLabel$> - (<$mt:AssetFileExt$>)</a></li>
<mt:If name="__last__">
package MoreCustomFields::SelectedAssets;
use strict;
use MT 4.2;
use base qw(MT::Plugin);
use CustomFields::Util qw( get_meta save_meta field_loop _get_html );
use MT::Util
qw( relative_date offset_time offset_time_list epoch2ts ts2epoch format_ts encode_html dirify );