diff --git a/2011-09-28/Makefile b/2011-09-28/Makefile new file mode 100644 index 0000000..c1769e1 --- /dev/null +++ b/2011-09-28/Makefile @@ -0,0 +1,12 @@ +JS = $(shell find public/javascripts -type f \( -iname "*.js" ! -name "*.min.js" \) ) +MINIFY = $(JS:.js=.min.js) + +all: clean $(MINIFY) + +clean: + rm -f $(MINIFY) + +%.min.js: %.js + node ./node_modules/uglify-js/bin/uglifyjs -o $@ $< + +.PHONY: clean js minify diff --git a/2011-09-28/README.md b/2011-09-28/README.md new file mode 100644 index 0000000..04e90ce --- /dev/null +++ b/2011-09-28/README.md @@ -0,0 +1,5 @@ +**This is not a fully-functional application** + +From this [blog post](http://www.ipreferjim.com/2011/09/makefile-setup-for-minifying-js-files-in-an-expressjs-application/) + +This shows how to add uglify-js as a dependency to package.json for an expressjs application and the accompanying Makefile to minify scripts. \ No newline at end of file diff --git a/2011-09-28/package.json b/2011-09-28/package.json new file mode 100644 index 0000000..50ef902 --- /dev/null +++ b/2011-09-28/package.json @@ -0,0 +1,11 @@ +// default package.js for an expressjs app using ejs and uglify-js +{ + "name": "application-name" + , "version": "0.0.1" + , "private": true + , "dependencies": { + "express": "2.4.6" + , "ejs": ">=0.4.3" + , "uglify-js": ">=1.1.0" + } +} diff --git a/2011-10-31/README.md b/2011-10-31/README.md new file mode 100644 index 0000000..db1f990 --- /dev/null +++ b/2011-10-31/README.md @@ -0,0 +1,5 @@ +From [this blog post](http://www.ipreferjim.com/2011/10/jquery-plugin-fixed-table-header/) + +# demo + +See the jsfiddle [here](http://jsfiddle.net/jimschubert/RMsqJ/) for a demo \ No newline at end of file diff --git a/2011-10-31/example.html b/2011-10-31/example.html new file mode 100644 index 0000000..7dc0ae0 --- /dev/null +++ b/2011-10-31/example.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + +
FirstSecondThirdFourth
+ +
+ +
\ No newline at end of file diff --git a/2011-10-31/jquery.fixedheader.js b/2011-10-31/jquery.fixedheader.js new file mode 100644 index 0000000..953f8dd --- /dev/null +++ b/2011-10-31/jquery.fixedheader.js @@ -0,0 +1,53 @@ +(function($) { + $.fn.fixedHeader = function(options) { + var settings = { + selector: 'thead:first', + cssClass: 'fixed', + fixTo: 0 + }; + + var _fixHeader = function(obj) { + var header = $(obj.selector, obj.elem); + if(header) { + var parent = header.parents('table:first') || header.parent(); + (parent && parent.css({ borderCollapse: 'collapse'}) ); + + var data = header.data('fixedHeader') || header.data('fixedHeader', { + top: header.offset().top, + width: parent.find('tr:eq(1)').width(), + cells: parent.find('tr:eq(1) > td'), + processed: false + }); + var top = data.top - $(document).scrollTop(); + if( top < 0 ) { + header.addClass(obj.css); + if(!data.processed){ + header.width(data.width); + for(var i = 0; i= 2 or die "usage: $0 input_file output_file 'sentence'\n"; +my ($infile, $outfile, $sentence) = @ARGV; +$sentence = $sentence || 'how much wood could a woodchuck chuck'; + +open INPUT, "< $infile" or die $!; +open OUTPUT, "> $outfile" or die $!; + +my $stdout = select STDOUT; +$| = 1; +select $stdout; + +my %sentence_letters; +my $stmp = $sentence; +$sentence_letters{$&}++ while($stmp =~ s/[a-z]//); + +print "Using the sentence '$sentence'\n"; +print "Found the following letters:\n"; +print "\t$_ - ". $sentence_letters{$_} ."\n" foreach(sort(keys %sentence_letters)); +print "Processing $infile for slogan words\n"; + +my $count = 0; +my @indicators = qw{\ / | .}; +LINE: while() { + my $word = $_; + my $tmp = $word; + next LINE if($word =~ /['\&\d]/); + my %word_letters; + $word_letters{$&}++ while($tmp =~ s/[a-z]//); + + foreach(keys %word_letters) { + next LINE if ($word_letters{$_} > $sentence_letters{$_}); + } + print OUTPUT $word; + + my $word_len = length($word); + open WORD_LEN_OUTPUT, ">> $outfile.$word_len"; + print WORD_LEN_OUTPUT $word; + + print $indicators[++$count % 4], "\r"; +} + +print "\nDone.\nView $outfile.* for words\n"; diff --git a/2012-03-23/README.md b/2012-03-23/README.md new file mode 100644 index 0000000..290b111 --- /dev/null +++ b/2012-03-23/README.md @@ -0,0 +1,3 @@ +[blog post](http://www.ipreferjim.com/2012/03/ubuntu-open-with-wireshark/) + +Save as ~/.local/share/applications/wireshark.desktop diff --git a/2012-03-23/wireshark.desktop b/2012-03-23/wireshark.desktop new file mode 100644 index 0000000..2b97c9a --- /dev/null +++ b/2012-03-23/wireshark.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Wireshark +Comment=Wireshark packet capturing +Exec=wireshark %u +Terminal=false +Type=Application +Icon=/usr/share/pixmaps/hi48-app-wireshark.png +Categories=Application;Utility; +StartupNotify=true +MimeType=application/octet-stream +NoDisplay=false + diff --git a/2012-04-16/Microsoft.Cpp.Win32.user.props b/2012-04-16/Microsoft.Cpp.Win32.user.props new file mode 100644 index 0000000..dbf79a6 --- /dev/null +++ b/2012-04-16/Microsoft.Cpp.Win32.user.props @@ -0,0 +1,12 @@ + + + + + _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + +