Skip to content

Instantly share code, notes, and snippets.

@notbenh
notbenh / output
Created April 2, 2014 16:11
output
Length Count
1 16
2 267
3 267
4 169
5 140
6 112
=head2 set_mfields
Wrapper around set_feilds to allow for a more flexible syntax.
$mech->set_mfields( $name => [ foo => 2, bar => 3] );
$mech->set_mfields( $name => [ foo => [2,3]] );
=cut
#!/usr/bin/perl
use strict;
use warnings;
print qq{Euclid's Algorithm 1.1E\n\n};
sub littleEuclid {
my ($m,$n) = @_;
my $remainder = $m % $n;
my $reply = $remainder
@notbenh
notbenh / output
Created November 25, 2013 23:22
script output
1 16
2 267
3 267
4 169
5 140
6 112
7 99
8 68
9 61
10 56
@notbenh
notbenh / output
Created November 18, 2013 20:35
output
Length Count
1 16
2 267
3 267
4 169
5 140
6 112
7 99
8 68
9 61
@notbenh
notbenh / gist:6836810
Created October 5, 2013 04:52
issue with upgrading slim
(2/2) checking for file conflicts [#######################################################] 100%
error: failed to commit transaction (conflicting files)
slim: /usr/bin/slimlock exists in filesystem
slim: /usr/share/man/man1/slimlock.1.gz exists in filesystem
Errors occurred, no packages were upgraded.
400 -| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
300 -| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
| *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
| *************** *** *** *** *** *** *** *** *** *** *** *** ***
@notbenh
notbenh / appender.py
Created September 10, 2013 22:04
Trying to both append and read from a file handle
#!/usr/bin/env python3
f = open('somefile.txt','a+')
while True:
text = input('Say something silly ')
if text:
f.write(text)
print('CONTENT:',f.read())
else:
f.close()
break
@notbenh
notbenh / vimperatorrc_nano
Created July 29, 2013 18:50
vimperator comands for web-nano
" keyword 'grade' to enter in to grading mode:
:command -nargs=0 grade :js content.document.getElementById('yui-gen6').click()
" 'prev' keyword to access the previous assignement:
:command -nargs=0 prev :js content.document.getElementById('menuitems').getElementsByTagName('li'[content.document.getElementById('menuitems').getElementsByTagName('li').length - 2].getElementsByTagName('a')[0].click()
@notbenh
notbenh / loops.pl
Last active December 17, 2015 22:18
Why am I not getting the expected output?
#!/usr/bin/perl
use strict;
use warnings;
my @a = (1,2,3,4,5);
foreach my $x (@a){
print "first FOREACH: $x and the array is [@a] \n";
}