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
Param( | |
[string]$source, | |
[string]$dest, | |
[string]$format = "yyyy/yyyy_MM/yyyy_MM_dd" | |
) | |
$shell = New-Object -ComObject Shell.Application | |
function Get-File-Date { | |
[CmdletBinding()] |
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
// Originally from: https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486 | |
Duration = | |
// Duration formatting | |
// * @konstatinos 1/25/2016 | |
// * Given a number of seconds, returns a format of "hh:mm:ss" | |
// | |
// We start with a duration in number of seconds | |
VAR Duration = [Change this value to the name of your column that contains your seconds value] | |
// There are 3,600 seconds in an hour | |
VAR Hours = |
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
if (!pm.collectionVariables.get("bearerToken") || Date.now() > new Date(pm.collectionVariables.get("bearerTokenExpiresOn") * 1000)) { | |
pm.sendRequest({ | |
url: 'https://login.microsoftonline.com/' + pm.collectionVariables.get("tenantId") + '/oauth2/token', | |
method: 'POST', | |
header: 'Content-Type: application/x-www-form-urlencoded', | |
body: { | |
mode: 'urlencoded', | |
urlencoded: [ | |
{ key: "grant_type", value: "client_credentials", disabled: false }, | |
{ key: "client_id", value: pm.collectionVariables.get("clientId"), disabled: false }, |
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
pm.sendRequest({ | |
url: 'https://login.microsoftonline.com/' + pm.environment.get("tenantId") + '/oauth2/token', | |
method: 'POST', | |
header: 'Content-Type: application/x-www-form-urlencoded', | |
body: { | |
mode: 'urlencoded', | |
urlencoded: [ | |
{key: "grant_type", value: "client_credentials", disabled: false}, | |
{key: "client_id", value: pm.environment.get("clientId"), disabled: false}, | |
{key: "client_secret", value: pm.environment.get("clientSecret"), disabled: false}, |
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
// 1. Go to https://www.yelp.com/user_details_reviews_self | |
// 2. Open dev tools F12 | |
// 3. Copy and paste this code into Console and hit enter. | |
// 4. This will delete the first review. You'll need to repeat #3 for every review. | |
$('.icon--18-trash').each(function(){$( this ).click();setTimeout(function(){$('input[value=reason_other]').click();setTimeout(function(){$('#js-delete-button').click();},500);},500);}); |
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
// See this doc for details: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security | |
var resourceUri = encodeURIComponent(postman.getGlobalVariable("hubName") + '.azure-devices.net'); // The resource uri | |
var expiry = Math.ceil((Date.now() / 1000) + postman.getGlobalVariable("expiresInMins") * 60); // Expire the token 60 minutes from now | |
var uriExpiry = resourceUri + '\n' + expiry; // this is the string format to gen signature from | |
var decodedKey = CryptoJS.enc.Base64.parse(postman.getGlobalVariable("signingKey")); // The SHA256 key is the Base64 decoded version of the IoT Hub key | |
var signature = CryptoJS.HmacSHA256(uriExpiry, decodedKey); // The signature generated from the decodedKey | |
var encodedUri = encodeURIComponent(CryptoJS.enc.Base64.stringify(signature)); // The url encoded version of the Base64 signature | |
// Construct authorization string (shared access signature) | |
var token = "SharedAccessSignature sr=" + resourceUri + "&sig=" + encodedUri + "&se=" + expiry; |
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
docker run --privileged -it -v /var/run/docker.sock:/var/run/docker.sock jongallant/ubuntu-docker-client | |
docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh | |
chroot /host |
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
{ | |
"_type":"export", | |
"__export_format":4, | |
"__export_date":"2021-02-26T15:46:44.984Z", | |
"__export_source":"insomnia.desktop.app:v2020.5.2", | |
"resources":[ | |
{ | |
"_id":"req_7bbaa70817c34e55bf70f64a26c0eff2", | |
"parentId":"fld_e3ddc403c123493a9bdd56aa59192655", | |
"modified":1614354317200, |
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
class MyTokenCredential implements coreHttp.TokenCredential { | |
public token: string; | |
public expiresOn: number; | |
constructor(token: string, expiresOn?: Date) { | |
this.token = token; | |
this.expiresOn = expiresOn | |
? expiresOn.getTime() |
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
let | |
BaseUrl = "https://api.github.com/search/issues", | |
Query = "q=azsdke2e", | |
Token = "enter your token here", | |
ItemsPerPage = 100, | |
Delay = 2, | |
GetItems = (PageNumber, ItemsPerPage) => | |
let Page = "&page=" & Text.From(PageNumber), | |
PerPage = "&per_page=" & Text.From(ItemsPerPage), | |
Url = BaseUrl & "?" & Query & Page & PerPage, |
NewerOlder