Skip to content

Instantly share code, notes, and snippets.

View MichaelPaulukonis's full-sized avatar

Michael Paulukonis MichaelPaulukonis

View GitHub Profile
@MichaelPaulukonis
MichaelPaulukonis / mjpgisttest.php
Last active December 21, 2015 20:28
this is a test gist
<?php
Markup('gist', 'inline',
'/\\(:gist(\\s+.*?)?:\\)/ei',
"IncludeGist(PSS('$1 '))");
function IncludeGist($arg) {
$gist= sprintf('<code data-gist-id="%s"></code>', $arg);
@MichaelPaulukonis
MichaelPaulukonis / app.config.xml
Created August 29, 2013 18:53
log4net simple configuration
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>
</configSections>
<log4net>
<!-- Define some output appenders -->
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="filename.log"/>
@MichaelPaulukonis
MichaelPaulukonis / tripledes.encrypt.php
Created September 10, 2013 14:32
TripleDES encryption in PHP (using unique initialization vector (iv)), used when encrypting in PHP and decrypting in C#
<?php
/*
Based on code from the following sources:
http://www.sanity-free.org/131/triple_des_between_php_and_csharp.html
http://www.sanity-free.org/forum/viewtopic.php?id=133
http://php.net/manual/en/function.mcrypt-encrypt.php
See Also:
http://php.net/manual/en/function.mcrypt-create-iv.php
@MichaelPaulukonis
MichaelPaulukonis / linkify.js
Created October 10, 2013 14:04
simple linkify (from MS Visual Studio upgrade report). See also: http://benalman.com/code/projects/javascript-linkify/examples/linkify/
// Linkifies the specified text content, replaces candidate links with html links
function linkify(text)
{
if(!text || 0 === text.length)
{
return text;
}
// Find http, https and ftp links and replace them with hyper links
var urlLink = /(http|https|ftp)\:\/\/[a-zA-Z0-9\-\.]+(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9\-\._\?\,\/\\\+&%\$#\=~;\{\}])*/gi;
@MichaelPaulukonis
MichaelPaulukonis / installcontextcommandlineparms.cs
Last active December 26, 2015 21:39
Simple (mis)use of `System.Configuration.Install` to get a simple key-value collection for command-line parameters. Look into nDesk or other tools for something more robust.
using System;
using System.Configuration.Install;
namespace SimpleCommandlineParms
{
class Program
{
static void Main(string[] args)
{
@MichaelPaulukonis
MichaelPaulukonis / nif.extended.md
Created November 6, 2013 19:21
Output of nif.py, with an extended sample set. As seen at https://github.com/MichaelPaulukonis/NaNoGenMo.yawp

Nif

"Mom! Mom! Mom! I'm a pup, am I? Mom? Was it a rat I saw? Dog, no poop on God! Camp Mac! Camp Mac! Mom, Mom, Mom! Was it a cat I saw? Dad! Dad! God's dog. Eep, I pee! Dumb mud. Dad! No lemons, no melon. Mom! A Santa at NASA. Dad! God saw I was dog. Poop! Was it a rat I saw? Dad! Was it a cat I saw? Dad! Dad! Dumb mud. Dad! Dad! Mad as Adam. Mom, Mom, Mom! Nate bit a Tibetan. Huh? Don't nod. Dad. Go, dog! Dog doo? Good God! Baby bab. Dad? Nate bit a Tibetan. Mom. Mad as Adam. Mom! Go, dog! Dad! Boobs! Boob. Mom. Lion oil! Mom! He did, eh? Mom, Mom, Mom! God saw I was dog. Dog, no poop on God! Go, dog! Dad. Spacecaps! Mom! Pa's a sap. Dog, no poop on God! God's dog. Mom, Mom, Mom! 'Rats live on no evil star!' Hah! Ew! Eat a ewe? Dog doo? Good God! As I pee, sir, I see Pisa! Huh? I did, did I? Dog, no poop on God! Ew! Eat a ewe? Huh? God saw I was dog. Mom? Mom. Mom? Ma has a ham. Hah! Boobs! Boob. Dad? Dad. Dad? Was it a

var MultiString = function(f) {
return f.toString().split('\n').slice(1, -1).join('\n');
}
var ms = MultiString(function() {/**
line one
line two
line 'three'
**/});
@MichaelPaulukonis
MichaelPaulukonis / reset.iis.bat
Last active December 28, 2015 16:29
reset IIS and clear tempfiles -- either all of them, or for a specific application. Target the framework as appropriate
@echo OFF
echo %time%
echo now executing IISRESET
iisreset
echo now removing tempfiles
@MichaelPaulukonis
MichaelPaulukonis / chocolatey.install.sh
Last active December 28, 2015 21:19
install chocolatey via powershell
@powershell -NoProfile -ExecutionPolicy unrestricted -Command
"iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
&& SET PATH=%PATH%;%systemdrive%\chocolatey\bin
LEADER: I don't think. My orders say I'm not supposed to know where I'm taking this boat, so I don't. But one look at you and I know it's gonna be hot, wherever it is.
GROUP: Communist.
CITY FATHER: Three drums of diesel fuel, PBR- Five...
WOMAN: Hello, out there!
1 MILE: We French always pay respect to the dead of our allies. You're all welcome. (pause) Y name is Hubert DeMarais. This is my family's plantation. It has been such for seventy years, and it will be such until we are all dead.
WIZARD: (to Jimmy) Tell them to get my chopper, get back to the hospital.
ZEKE: Charlie don't surf!
SCARECROW AND TIN MAN: (to Chef) You see anything, Chef?
THE THREE: Hey, buddy, you gonna shut the door?
FATHER NO. 1: (to Lance) We'll come in low out of the rising sun, and about a mile out, we'll put on the music.