Skip to content

Instantly share code, notes, and snippets.

View mavinger's full-sized avatar
🦊

Matt Avinger mavinger

🦊
View GitHub Profile
@mavinger
mavinger / .htaccess
Last active August 29, 2015 14:21 — forked from ScottPhillips/.htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@mavinger
mavinger / .mongorc.js
Last active August 29, 2015 14:15 — forked from yanatan16/.mongorc.js
(function () {
rcversion = '1.0';
load('underscore.min.js')
// NOTES
// Basics, wrap the whole thing in a function
// Set a version for sanity's sake
// Load underscore, a must in any javascript environment
@mavinger
mavinger / mongodb-install.ps1
Last active August 29, 2015 14:14 — forked from serdarb/Download and Install MongoDB as Windows Service PowerShell Script
Download and Install MongoDB as Windows Service PowerShell Script
# Borrowed from: http://blogs.msdn.com/b/jasonn/archive/2013/06/11/8594493.aspx
function downloadFile($url, $targetFile) {
$uri = New-Object "System.Uri" "$url"
$request = [System.Net.HttpWebRequest]::Create($uri)
$request.set_Timeout(15000) #15 second timeout
$response = $request.GetResponse()
$totalLength = [System.Math]::Floor($response.get_ContentLength()/1024)
$responseStream = $response.GetResponseStream()
$targetStream = New-Object -TypeName System.IO.FileStream -ArgumentList $targetFile, Create
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},