Skip to content

Instantly share code, notes, and snippets.

View warthurton's full-sized avatar

Wayne Arthurton warthurton

View GitHub Profile
@9to5IT
9to5IT / Script_Template.ps1
Last active June 5, 2024 14:47
PowerShell: Script Template
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
@surrealchemist
surrealchemist / auth-basic.conf
Last active July 3, 2019 12:28 — forked from Thermionix/auth-basic.conf
Adding "port_in_redirect off;" which fixes the problem caused when your router is forwarding from a different port. This stops nginx from adding the port back in which is needed in a couple cases.
auth_basic "Restricted";
auth_basic_user_file /usr/local/etc/nginx/htpasswd;
@drdrang
drdrang / Location.py
Created January 9, 2014 04:55
A Pythonista script that gets the address, latitude, and longitude and sends them to Drafts.
import sys
import location, time
import urllib, webbrowser
# Handle argument, if present.
try:
a = sys.argv[1]
except IndexError:
a = ''
<response><info><statusCode>0</statusCode><messages/><copyright><imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl><imageAltText>© 2013 MapQuest, Inc.</imageAltText><text>© 2013 MapQuest, Inc.</text></copyright></info><route><sessionId>52a40dc1-0205-000c-02b7-04a6-d485645ba5f2</sessionId><options><shapeFormat>raw</shapeFormat><generalize>-1.0</generalize><maxLinkId>0</maxLinkId><narrativeType>text</narrativeType><stateBoundaryDisplay>true</stateBoundaryDisplay><countryBoundaryDisplay>true</countryBoundaryDisplay><sideOfStreetDisplay>true</sideOfStreetDisplay><destinationManeuverDisplay>true</destinationManeuverDisplay><avoidTimedConditions>false</avoidTimedConditions><enhancedNarrative>false</enhancedNarrative><returnLinkDirections>false</returnLinkDirections><timeType>0</timeType><routeType>FASTEST</routeType><locale>en_US</locale><unit>M</unit><tryAvoidLinkIds></tryAvoidLinkIds><mustAvoidLinkIds></mustAvoidLinkIds><manmaps>true</manmaps><drivingStyle>2</drivingStyle><highwayEfficiency>22.0</highwayEffi
@sukharevd
sukharevd / aws-s3-gzip-compression.py
Last active February 14, 2024 10:43
Synchronizes directory with gzipped content of Amazon S3 bucket with local one to avoid redundant synchronization requests when files were not changed, but MD5 sums of Gzipped files are different.
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
AWS S3 Gzip compression utility
Author: Dmitriy Sukharev
Modified: 2013-09-11
-------
Synchronizes directory with gzipped content of Amazon S3 bucket with local
# update_timezones.py
# Aleksandr Pasechnik
#
# Goes through the Day One jounal and sets the Time Zone of each entry that
# doesn't already have one to the value of the *timezone* variable. Makes a
# backup copy of each entry it modified by adding a '.tzbak' to the filename.
# Ignores any entry that already has a '.tzbak' version.
#
# NOTE: base_dir may need to be adjusted to the correct Journal_dayone location
# NOTE: It is probably a good idea to have a full journal backup just in case
@brettkelly
brettkelly / main.py
Created November 14, 2012 20:04
Share a single note
def shareSingleNote(authToken, noteStore, userStore, noteGuid, shardId=None):
"""
Share a single note and return the public URL for the note
"""
if not shardId:
shardId = getUserShardId(authToken, userStore)
if not shardId:
raise SystemExit
try:
@Thermionix
Thermionix / auth-basic.conf
Last active November 4, 2021 00:56
nginx reverse proxy for sickbeard, couchpotato etc.
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@btoone
btoone / curl.md
Last active May 14, 2024 19:32
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@bergerjac
bergerjac / ControlHelpers.cs
Created March 18, 2012 16:23
LightSwitch: Strong Type FindControl
// Client
using System;
using System.Diagnostics;
using System.Windows.Controls;
using Microsoft.LightSwitch.Presentation;
using Microsoft.LightSwitch.Presentation.Extensions;
namespace LightSwitchApplication
{