Skip to content

Instantly share code, notes, and snippets.

View jtroe's full-sized avatar

Jay Roebuck jtroe

View GitHub Profile
@jtroe
jtroe / Mediakeys.ahk
Created July 29, 2019 21:43 — forked from mistic100/Mediakeys.ahk
Media keys shortcuts for AutoHotkey
; AutoHotkey Media Keys
^!Space::Send {Media_Play_Pause}
^!Left::Send {Media_Prev}
^!Right::Send {Media_Next}
^!NumpadMult::Send {Volume_Mute}
^!NumpadAdd::Send {Volume_Up}
^!NumpadSub::Send {Volume_Down}
@jtroe
jtroe / install_vpn.sh
Created July 21, 2017 21:34 — forked from lorepozo/install_vpn.sh
automatically install and configure a VPN server — IKEv2 over IPsec
#!/bin/bash
# install_vpn.sh
# automatically install and configure a VPN -- IKEv2 over IPsec
# using strongswan and iptables
#
# tested on Ubuntu 16.04, probably works on arch (implemented without trying it).
# note: this script is full of &>/dev/null to help make the output pretty.
#
# huge thanks to Namo's tutorial:
# https://www.digitalocean.com/community/tutorials/how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-16-04
@jtroe
jtroe / FIPS.sql
Created October 14, 2015 20:40 — forked from maplion/FIPS.sql
Get FIPS code for County by Lat/Long by @maplion for @simplot
/*
Returns County Data for given LATITUDE and LONGITUDE
Example usage:
select a.Latitude, a.Longitude, a.Area, f.NAME, f.FIPS from World.dbo.Locations a --any table with Latitude and Longitude
cross apply dbo.Get_County_From_Lat_Long(a.Latitude, a.Longitude) f
*/
CREATE FUNCTION [dbo].[Get_County_From_Lat_Long] (
@LATITUDE NUMERIC(10,6),
@LONGITUDE NUMERIC(10,6)
// First add the option in the Rules menu:
// Add these lines after the other options (m_Japanese ...)
// Enables hiding of VS2013 BrowserLink feature requests
public static RulesOption("Hide SignalR/BrowserLink")
var m_SignalRBrowserLink: boolean = false;
// Add the following at the end of OnBeforeRequest
if (m_SignalRBrowserLink && (oSession.uriContains("SignalR") || oSession.uriContains("__BrowserLink") || oSession.oRequest.headers.RequestPath.EndsWith("/browserLink"))){
oSession["ui-hide"] = "SignalR";
}
'''
NOTES:
- See the ArcGIS REST API documentation for supported operations, methods, and syntax:
http://resources.arcgis.com/en/help/arcgis-rest-api/
- A TOKEN must be passed as parameter in addition to any required inputs for the operation.
- "urllib.urlencode" handles spaces and other special characters in parameters so that valid URLs are constructed.
- "urllib.urlopen" sends the reqest and handles the response.
- Parameters are appended to URL for GET (see Example 1), but passed to "urlopen" for POST (see Example 2). API docs specifiy supported methods for each operation.
- "json.loads" converts string responses to parseable JSON objects.