This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Can also add to PowerShell profile | |
function Git-RemovedMergedBranches { | |
git branch --merged | | |
? { $_ -NotMatch "^\*" } | | |
? { $_ -NotMatch "master" } | | |
% { $_.Trim() } | | |
% { git branch -d $_ } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = firstName lastName | |
email = email | |
[core] | |
preloadindex = true | |
fscache = true | |
autocrlf = false | |
safecrlf = false | |
symlinks = true | |
commitGraph = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#n::Run "C:\Program Files (x86)\Notepad++\notepad++.exe" | |
#c::Run "C:\Program Files\ConEmu\ConEmu64.exe" | |
#v:: ; Text–only paste from ClipBoard | |
Clip0 = %ClipBoardAll% | |
ClipBoard = %ClipBoard% ; Convert to text | |
Send ^v ; For best compatibility: SendPlay | |
Sleep 50 ; Don't change clipboard while it is pasted! (Sleep > 0) | |
ClipBoard = %Clip0% ; Restore original ClipBoard | |
VarSetCapacity(Clip0, 0) ; Free memory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D2LAppContextFactory appContextFactory = new D2LAppContextFactory(); | |
ID2LAppContext appContext = appContextFactory.Create(appId, appKey); | |
UserContextProperties userContextProperties = new UserContextProperties() { | |
UserId = myUserId, // put your user ID here | |
UserKey = myUserKey, // put your user key here | |
Scheme = "https", | |
HostName = bsUrl, | |
Port = port | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; http://superuser.com/a/784683/502760 | |
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
#InstallKeybdHook | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; OPTIONAL: For those who use Home/End more than PgUp/PgDown, this flips their use with the Fn key. | |
; If you want the buttons to function as they are, add a semicolon (;) to the beginning of each line below. | |
; Home::PgUp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-----------------+ +-----------------+ +-----------------+ | |
| | | | | | | |
| Sample App | | User / Browser | | Auth Server | | |
| | | | | | | |
+--------+--------+ +--------+--------+ +--------+--------+ | |
| | | | |
| | | | |
| GET /auth | | | |
| <----------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests # requests==2.7.0 | |
url = "http://localhost:44453/d2l/api/lp/1.0/users/whoami" | |
access_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjBiOWU5Njg2LWRiYTctNDBkNS05MmRlLTYxNmVkNmYzZmJhMSJ9.eyJzdWIiOiIxNjkiLCJ0ZW5hbnRpZCI6IjNlZGE2ZTJhLWNmZjItNGE0OS1hZjQ5LWY4MmUzZWUzZTkxMSIsInNjb3BlIjoiY29yZToqOioiLCJqdGkiOiJlNDI0YjQyZi1hZTY5LTQ4ZGItYWUzMS00ZjhlZTQ1NDBkNmEiLCJpc3MiOiJodHRwczovL2FwaS5icmlnaHRzcGFjZS5jb20vYXV0aCIsImF1ZCI6Imh0dHBzOi8vYXBpLmJyaWdodHNwYWNlLmNvbS9hdXRoL3Rva2VuIiwiZXhwIjoxNDc5OTIxMTUxLCJuYmYiOjE0Nzk5MTc1NTF9.GznF7Wl-DQxJ3Qp7OPJ4PU_nhHzCzaHYcAFlgahLXyBhAqqAQWKYcrID8UB478iwL2ntYPCtJKLCsJp-ZzZ4QMNc0rwFSJ6_jpQ9W3ALYgIBhILuabG-Xkfdnv4Bi-ME4Q1RcNUvNuuP7ygaJtONc7S4hJtYagsmI9JOW46h-64nevDLijO4CJOIq9B27k_PjPzisAET0ziUD6swIvhX7rUz_nOmCWZJDP56Mi-LIMSd7GrTYP9dTnwvw_rmU_iliO8iOqSKtPaaYUBF9gK4Zulg93nNZDybZozM9sxlfvdRrnjDq6PPUCIbyG1zFwD3GH7-bE9HlemSElhuxyMqSg" | |
response = requests.get(url, headers={'authorization': "Bearer {}".format(access_token)}) | |
print(response.json()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim client As New RestSharp.RestClient("https://auth.brightspace.com/core/connect/token") | |
' Must use basic auth | |
client.Authenticator = new HttpBasicAuthenticator("(client id)", "(client secret)"); | |
Dim req As New RestSharp.RestRequest(Method.POST) | |
req.AddHeader("Content-Type", "application/x-www-form-urlencoded") | |
req.AddHeader("Accept", "application/json") | |
req.AddParameter("grant_type", "refresh_token") | |
req.AddParameter("refresh_token", "(manually obtained refresh token)") | |
req.AddParameter("scope", "Application:*:* Core:*:* Data:*:*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Id": "a3769712-3b2a-47e8-8206-85cdaf882384", | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "NoDelete", | |
"Action": [ | |
"s3:Delete*", | |
"s3:PutBucketPolicy" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIT License | |
Copyright (c) 2017 Mark Tse | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
OlderNewer