Skip to content

Instantly share code, notes, and snippets.

View ntotten's full-sized avatar

Nathan Totten ntotten

View GitHub Profile
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
<lightning:card title="Walk Score" iconName="custom:custom5">
<div style="padding: 0; margin: 0; border: 0; outline: 0; position: relative; width: 100%; padding-bottom: 30%">
<div style="padding: 0; margin: 0; border: 0; outline: 0; position: absolute; top: 0; bottom: 0; left: 0; right: 0;">
<img src="//pp.walk.sc/badge/walk/1099-Stewart-St-Seattle-98101.svg"
style="border-radius: 0; box-shadow: none; outline: 0; color: transparent; margin: 0 0 0 2.000000%; float: left; padding: 0; width: 30.666667%; background: none; border: 0;"
alt="Walk Score of 1099 Stewart Street Seattle WA 98101" />
<img src="//pp.walk.sc/badge/transit/1099-Stewart-St-Seattle-98101.svg"
style="border-radius: 0; box-shadow: none; outline: 0; color: transparent; margin: 0 0 0 2.000000%; float: left; padding: 0; width: 30.666667%; background: none; border: 0;"
alt="Transit Score of 1099 Stewar
@ntotten
ntotten / apex.js
Created March 9, 2018 18:53
Monaco language definition for apex. Still needs inline SOQL.
// Language definition for Apex
return {
// Set defaultToken to invalid to see what you do not tokenize yet
// defaultToken: 'invalid',
keywords: [
'abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default',
'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private',
'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte',
'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return',
'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final',
993898: QUIC_SESSION
r6---sn-jvh2vgp0h-jaul.googlevideo.com
Start Time: 2017-10-05 10:48:25.236
t=247821 [st= 0] +QUIC_SESSION [dt=12388]
--> cert_verify_flags = 6
--> host = "r6---sn-jvh2vgp0h-jaul.googlevideo.com"
--> port = 443
--> privacy_mode = true
--> require_confirmation = false
@ntotten
ntotten / certrenew.sh
Created July 29, 2017 17:12
Script to renew Let's Encrypt certificate and then replace certificate on OpenVPN server
#!/bin/bash
(
DOMAIN="vpn.example.com"
set -eu
certbot renew -q
/usr/local/openvpn_as/scripts/sacli stop
@ntotten
ntotten / certrenew.sh
Created July 29, 2017 17:12
Script to renew Let's Encrypt certificate and then replace certificate on OpenVPN server
#!/bin/bash
(
DOMAIN="vpn.example.com"
set -eu
certbot renew -q
/usr/local/openvpn_as/scripts/sacli stop
@ntotten
ntotten / authorization.sh
Created July 29, 2017 16:41
Let's Encrypt Certbot Authorization Hook for DNSimple
#!/bin/bash
(
ACCESS_TOKEN="YOUR_ACCESS_TOKEN_HERE" # See https://developer.dnsimple.com/v2/oauth/
ACCOUNT_ID="YOUR_ACCOUNT_ID"
DOMAIN="YOUR_DOMAIN"
RECORD_ID="YOUR_RECORD_ID"
if [[ ! $(type -P curl) ]] ; then
@ntotten
ntotten / README.md
Last active April 6, 2017 18:32
Change Password Webtask

Change Password Webtask

In order to use this Auth0 WebTask you simply need to follow these instructions.

You first need to create an Auth0 Client and authorize this client to call the management API;

  1. Create a new Auth0 Client called "Change Password Service"
  2. Select the type of the client to be "Non-Interactive"
  3. On the "quickstart" screen that is show select "Auth0 Management API" in the drop down. This will show a orange box that says "This client is not authorized for this API."
  4. Click the button that says to "Navigate to the API and Authorize"
  5. Toggle the "Change Password Service" to authorized.
class ViewController: UIViewController {
@IBOutlet weak var oldPassword: UITextField!
@IBOutlet weak var newPassword: UITextField!
@IBOutlet weak var confirmPassword: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
router.post('/change-password', middlewares.updateUserProfile, (req, res, next) => {
if (req.user.identities[0].isSocial) {
return sendError(400, 'Cannot update social account', next);
}
if (req.body.password !== req.body.confirm) {
return sendError(400, 'Password mismatch', next);
}
return auth0Utils.validatePassword(req.user, req.body.current)