Skip to content

Instantly share code, notes, and snippets.

View robbiet480's full-sized avatar
😩
terminally online

Robbie Trencheny robbiet480

😩
terminally online
View GitHub Profile
@robbiet480
robbiet480 / Collect_Instagram_Ad_Interests.js
Created June 20, 2019 22:18
A lil script to collect all of your Instagram ad interests automatically so you don't have to keep clicking "Show More".
// 1. On your computer, go to https://www.instagram.com/accounts/access_tool/ads_interests
// 2. Open dev tools by right clicking on the page and selecting "Inspect"
// 3. Click Console
// 4. Paste the following code
// 5. Hit enter
// 6. Wait
// 7. It will print out your list of interests once its done.
var allInterests = [];
{
"basics": {
"name": "Robert Trencheny",
"label": "Head Of Infrastructure at Flatfile Inc.",
"picture": "",
"email": "me@robbiet.us",
"phone": "9258843728",
"website": "",
"summary": "Experienced Internet Consultant with a demonstrated history of working in the internet industry. Skilled in Web Applications, Amazon Web Services (AWS), PaaS, Docker and Kubernetes. Strong operations professional graduated from Y Combinator. ",
"location": {
@robbiet480
robbiet480 / AWSRegionType+Helpers.swift
Last active November 16, 2020 10:00
Extensions to AWSRegionType to turn a string into a region name and lookup simple information about a region
import AWSCore
extension AWSRegionType {
/**
Return an AWSRegionType for the given string
- Parameter regionString: The Region name (e.g. us-east-1) as a string
- Returns: A new AWSRegionType for the given string, Unknown if no region was found.
server {
listen 80;
server_name yournamehere.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name yournamehere.com;
@robbiet480
robbiet480 / swift4-icons.stencil
Created May 15, 2019 04:49
A SwiftGen template for generating icon enums and helpers.
// swiftlint:disable all
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
import UIKit
{% if families %}
{% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %}
{% for family in families %}
{% set enumName %}{{param.enumName|default:family.name}}{% endset %}
/** A wrapper class for Objective-C compatibility. */
@robbiet480
robbiet480 / README.md
Last active October 23, 2019 18:13
A consul-template plugin to get EC2 metadata

ec2-consul-template-plugin

About

This is a simple little Python script to let you query EC2 metadata from consul-template. It's only requirement is boto. It uses the EC2 internal metadata service so it does not require any API keys or even a region. The only caveat is that this can only be run on a machine on EC2.

Usage

You can give no arguments for full dictionary output or one or more arguments to get specific key(s). Put it somewhere on your machine, chmod +x it and give the full path to consul-template.

Examples

@robbiet480
robbiet480 / bookmarklet.js
Created February 5, 2013 02:40
Reveal Password bookmarklet
javascript:(function()%7Bvar%20IN%20=%20document.getElementsByTagName(%22input%22);for(var%20i=0;%20i<IN.length;%20++i)%7BF%20=%20IN%5Bi%5D;if%20(F.type.toLowerCase()%20==%20%22password%22)%7Bif(document.all)%7Bvar%20n%20=%20document.createElement(%22input%22);for(var%20k%20in%20F.attributes)%20if(k.toLowerCase()%20!=%20'type')%7Btry%7Bn%5Bk%5D%20=%20F%5Bk%5D%7Dcatch(err)%7B%7D%7D;F.parentNode.replaceChild(n,F);%7Delse%7BF.type=%22text%22%7D%7D%7D%7D)()
@robbiet480
robbiet480 / extract_watch_image_sizes.js
Created October 1, 2018 14:08
Extract image dimensions from the watchOS HIG
// Run this on https://developer.apple.com/design/human-interface-guidelines/watchos/icons-and-images/complication-images/
function pascalCase(str) {
var fixed = str.replace(/(\w)(\w*)/g, function(g0,g1,g2){return g1.toUpperCase() + g2.toLowerCase();}).split(' ').join('');
if(fixed.indexOf('(') > -1) {
fixed = fixed.substring(0, fixed.indexOf('('));
}
return fixed;
}
@robbiet480
robbiet480 / directions_example.html
Created September 1, 2011 07:30
This HTML file contains Javascript code to detect location and redirect to Google Maps. Useful to tell people when they call asking for directions "go to http://robbiet.us/directions/" and it will auto direct them based on Geolocation. Uses Modernizr
<!DOCTYPE html>
<html>
<head>
<title>Directions Example</title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js"></script>
<script type="text/javascript">
//Ask for HTML5 geolocation, use Modernizr to detect if we can even do it. If allow, go to show_map, if deny go to handle_error. Please note the High Accuracy flag, which may cause the location fix to take longer, but it gives a more precise reading
function get_location() {
if (Modernizr.geolocation) {
navigator.geolocation.getCurrentPosition(show_map, handle_error, {maximumAge: 75000, enableHighAccuracy: true});
@robbiet480
robbiet480 / Dehydrated_FreeNAS.py
Last active July 23, 2018 23:15
A script to install Lets Encrypt certificates generated by Dehydrated into FreeNAS
#!/usr/local/bin/python
"""
Import and activate a SSL/TLS certificate generated by dehydrated.sh into FreeNAS 11.1 or later
Uses the FreeNAS API to make the change, so everything's properly saved
in the config database and captured in a backup.
Requires paths to the cert (including the any intermediate CA certs) and
private key, and username, password, and FQDN of your FreeNAS system.