Skip to content

Instantly share code, notes, and snippets.

Avatar

ade ishs adeishs

View GitHub Profile
View list-slurp-fix.pl
#!/usr/bin/env perl
use strict;
use List::Util qw(any);
use Data::Dumper::Concise;
my %h = (
k1 => {
s1 => 0,
s2 => 0,
View keybase.md

Keybase proof

I hereby claim:

  • I am adeishs on github.
  • I am adeishs (https://keybase.io/adeishs) on keybase.
  • I have a public key ASDQlVBSXewGedj1Ivd9i-shtY31suJQLNx4RrpyVqvNcgo

To claim this, I am signing this object:

@adeishs
adeishs / .bash_profile
Created Nov 29, 2018
My .bash_profile
View .bash_profile
#!/bin/bash
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
source ~/git-completion.bash
# https://perlbrew.pl/
source ~/perl5/perlbrew/etc/bashrc
@adeishs
adeishs / .vimrc
Last active Dec 1, 2018
My .vimrc
View .vimrc
execute pathogen#infect()
colorscheme borland
set nu
set title
set guifont=Source\ Code\ Pro:h13
set termencoding=utf-8
set encoding=utf-8
set fileencoding=utf-8
set shiftwidth=4 softtabstop=4 smarttab expandtab
set colorcolumn=80
@adeishs
adeishs / multilevel-dict-solution.py
Last active Mar 21, 2018
Multilevel Dictionary (Solution)
View multilevel-dict-solution.py
#!/usr/bin/env python
import collections
import pprint
dict_factory = lambda: collections.defaultdict(dict_factory)
x = collections.defaultdict(dict_factory)
x['a']['b']['c']['d'] = 1
print x['a']['b']['c']['d']
print pprint.pformat(x) # looks a bit messy, but it gives you the idea
@adeishs
adeishs / multilevel-dict-broken.py
Created Mar 21, 2018
Multilevel Dictionary (Broken)
View multilevel-dict-broken.py
#!/usr/bin/env python
x = {}
x['a']['b']['c']['d'] = 1
@adeishs
adeishs / hashref-hashref.pl
Last active Mar 21, 2018
Perl hashref of hashref
View hashref-hashref.pl
#!/usr/bin/perl
use strict;
use Data::Dumper;
my $x;
$x->{a}->{b}->{c}->{d} = 1;
print Dumper($x)
=begin output
@adeishs
adeishs / jquery-lining-up-table-cols.js
Last active Mar 8, 2018
Lining Up Table Columns with jQuery
View jquery-lining-up-table-cols.js
<script type="text/javascript">
$(function() {
var widths = new Array;
/* get max column widths from tables */
$('table').each(function() {
i = 0;
$(this).find('thead th').each(function() {
w = $(this).width();
You can’t perform that action at this time.