Skip to content

Instantly share code, notes, and snippets.

View huertanix's full-sized avatar
💬
is typing

David Huerta huertanix

💬
is typing
View GitHub Profile
@huertanix
huertanix / torrc
Last active December 13, 2015 03:50
Example Tor Non-Exit Relay Configuration for a DigitalOcean Droplet
# 9001 is the port Tor will use for relaying traffic through.
# 9030 is the port used for the global Tor directory.
ORPort 9001
DirPort 9030
# These basically determine how much to throttle traffic.
# 770 Kilobytes per second should keep us from burning through our
# 2 TB per month cap too quickly.
@huertanix
huertanix / right-click-block
Created April 9, 2015 17:04
Blocking right-click context menus in web browsers
(function () {
var blockContextMenu, myElement;
blockContextMenu = function (evt) {
evt.preventDefault();
};
window.addEventListener('contextmenu', blockContextMenu);
})();
@huertanix
huertanix / keybase.md
Created April 18, 2014 02:58
Proving my identity on Keybase.

Keybase proof

I hereby claim:

  • I am huertanix on github.
  • I am huertanix (https://keybase.io/huertanix) on keybase.
  • I have a public key whose fingerprint is 1482 F3BF 3F16 6BD4 3525 D55E 35D7 26BD AE09 F328

To claim this, I am signing this object:

@huertanix
huertanix / gist:5604863
Created May 18, 2013 15:45
huertor's limited exit policy
ExitPolicy accept *:20-23 # FTP, SSH, telnet
ExitPolicy accept *:43 # WHOIS
ExitPolicy accept *:53 # DNS
ExitPolicy accept *:79-81 # finger, HTTP
ExitPolicy accept *:88 # kerberos
ExitPolicy accept *:110 # POP3
ExitPolicy accept *:143 # IMAP
ExitPolicy accept *:194 # IRC
ExitPolicy accept *:220 # IMAP3
ExitPolicy accept *:389 # LDAP
@huertanix
huertanix / SimpleGeoRubyExample.rb
Created March 15, 2011 01:15
A full example on how to get latitude and longitude from SimpleGeo's Place API with a US postal address.
# Using Ruby 1.9.2
require 'simplegeo'
require 'json'
full_address = "960 West University Dr #103 Tempe, AZ"
geo_options = {'radius' => 0.1}
closest_locations = SimpleGeo::Client.get_places_by_address(full_address, geo_options)
coordinates = JSON.parse(closest_locations.to_json)['features'][0]['geometry']['coordinates']
longitude = coordinates[0]