Skip to content

Instantly share code, notes, and snippets.

View jimschubert's full-sized avatar
🎯
Always here to help.

Jim Schubert jimschubert

🎯
Always here to help.
  • Richmond, VA
View GitHub Profile
@jimschubert
jimschubert / filter_logs.pl
Created July 20, 2011 21:55
perl script to filter apache logs by http status code
#!/usr/bin/env perl
# This script filters an apache log by HTTP code and outputs in a slightly more readable fashion.
my $usage = <<"USAGE";
usage: $0 logfile status_code
For example:
$0 apache.log 302
$0 apache.log
Notes:
Status 200 is shown by default
USAGE
@jimschubert
jimschubert / propv.snippet
Created September 23, 2011 13:08
Auto-implemented virtual property snippet for C#
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>propv</Title>
<Shortcut>propv</Shortcut>
<Description>Code snippet for an automatically implemented virtual property
Language Version: C# 3.0 or higher</Description>
<Author>James Schubert</Author>
<SnippetTypes>
@jimschubert
jimschubert / Makefile
Created September 29, 2011 02:12
Minify your .js files using uglify-js (expressjs)
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 $@ $<
@jimschubert
jimschubert / gwt-calc.java
Created October 30, 2011 13:06
A calculator written in Google Web Toolkit
/*
The MIT License
Copyright (c) 2011 Jim Schubert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@jimschubert
jimschubert / FilterCode.cs
Created December 13, 2011 21:10 — forked from phpleo/FilterCode.cs
Extrayendo el texto de un PDF con IFilter, se usa "Adobe PDF IFilter v6.0" con un proyecto en ASP MVC 2
///
/// Sample library for using IFilter to read text from any registered filter type.
///
/// Helpful links:
/// http://msdn.microsoft.com/en-us/library/ms691105(VS.85).aspx
/// http://ifilter.codeplex.com/
/// http://www.pinvoke.net/default.aspx/query/LoadIFilter.html
///
/// Code here is taken from a combination of the project located at http://ifilter.codeplex.com/
/// as well as definitions taken from p-invoke.net. License is MS-PL so enjoy.
@jimschubert
jimschubert / README.md
Created December 22, 2011 21:00
Common disposable logic
@jimschubert
jimschubert / words.pl
Created February 3, 2012 23:59
words.pl: Find all possible slogan words from a single sentence.
#!/usr/bin/env perl
# words.pl: Find all possible slogan words from a single sentence.
use strict; $|++;
@ARGV >= 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 $!;
@jimschubert
jimschubert / README.md
Created March 25, 2012 23:18
dep.awk and dep.sh

dep.awk and dep.sh

Some code for a question on StackOverflow. see here.

Inputs taken from the list of Linux Kernel Contributors.

Output lines are numbered. Remove the i, from the print line to remove the numbers.

@jimschubert
jimschubert / Program.vb
Created March 31, 2012 14:24
Trying out CInt in response to a site contact email
Public Class Application
Public Shared Sub Main()
System.Console.WriteLine("Trying out CInt")
Try
' CInt Float
Dim FLOAT_VAL As Single = 99.09
Dim i As Integer = CInt(FLOAT_VAL)
@jimschubert
jimschubert / Readme.md
Created September 20, 2012 00:52
For sale: Sony Vaio VGN-NW150J

For Sale

Sony Vaio VGN-NW150J

Sony Vaio VGN-NW150J (Sony link)

Features

  • Intel® Core™ 2 Duo T6500 (2.10GHz)
  • Genuine Windows Vista® Home Premium