This file contains hidden or 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
| using namespace System.Collections.Concurrent | |
| $StartDate = [datetime]::UtcNow | |
| # can be generated with something like | |
| # 1..10 | %{ Get-Credential} | Export-CliXml -path 'C:\reports\InboxRules\Creds.xml' | |
| # Which will prompt for credentials 10 times and store them in the xml file | |
| $CredentialFile = 'C:\reports\InboxRules\Creds.xml' | |
| $RunDate = $StartDate.ToString('o') -replace ':' | |
| # This is the path of the CSV file. It is imperative that this file not be | |
| # access while the script is running |
This file contains hidden or 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
| URI = "https://www.16personalities.com/free-personality-test" | |
| from selenium.webdriver import Chrome, ChromeOptions | |
| from selenium.webdriver.support import expected_conditions as EC | |
| from selenium.webdriver.support.ui import WebDriverWait | |
| from selenium.webdriver.common.by import By |
This file contains hidden or 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
| // https://github.com/auth0-community/auth0-xamarin-oidc-samples/tree/master/Quickstart/01-Login/iOS | |
| using System; | |
| using UIKit; | |
| using Auth0.OidcClient; | |
| using System.Text; | |
| using LocalAuthentication; | |
| using Foundation; | |
| using Xamarin.Auth; |
This file contains hidden or 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
| # escape=` | |
| FROM mcr.microsoft.com/windows/servercore:ltsc2019 | |
| # Install .NET 4.8 | |
| RUN curl -fSLo dotnet-framework-installer.exe https://download.visualstudio.microsoft.com/download/pr/7afca223-55d2-470a-8edc-6a1739ae3252/abd170b4b0ec15ad0222a809b761a036/ndp48-x86-x64-allos-enu.exe ` | |
| && .\dotnet-framework-installer.exe /q ` | |
| && del .\dotnet-framework-installer.exe ` | |
| && powershell Remove-Item -Force -Recurse ${Env:TEMP}\* |
This file contains hidden or 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
| $today = [System.DateTime]::Today.ToString("yyyyMMdd") | |
| Import-Csv -Header Column1,Column2 -Delim ',' 'C:\sample.csv' | | |
| ForEach { | |
| New-Object psobject -Property @{Date=$today;Col1=$_.Column1; Col2=$_.Column2} | |
| } | Select-Object Date,Col1,Col2 | Export-Csv -NoTypeInformation 'C:\sample.csv' |
This file contains hidden or 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
| # Creates and provisions DO cloud server for WordPress | |
| resource "digitalocean_droplet" "wordpress" { | |
| image = "centos-7-x64" | |
| name = "${var.do_wordpress_name}" | |
| region = "${var.do_region}" | |
| size = "${var.do_wordpress_size}" | |
| ipv6 = true | |
| monitoring = true | |
| ssh_keys = [ |
This file contains hidden or 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
| Mounting a s3ql file system to the S3 compatible file system at Softlayer on an Ubuntu 16 Xenial VSI | |
| apt install s3ql | |
| nano /etc/s3ql.authinfo | |
| [softlayer-s3] | |
| backend-login: somelogin |
This file contains hidden or 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
| public abstract class AWS { | |
| // Post initialization logic (after constructor, before call) | |
| protected abstract void init(); | |
| // XML Node utility methods that will help read elements | |
| public static Boolean getChildNodeBoolean(Dom.XmlNode node, String ns, String name) { | |
| try { | |
| return Boolean.valueOf(node.getChildElement(name, ns).getText()); | |
| } catch(Exception e) { | |
| return null; |
This file contains hidden or 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
| def get_kncg(df, K=4): | |
| # df is a pandas dataframe with mandatory columns ['x','y'] | |
| graph = get_knntree(df, 1) | |
| for node_a, row in df.iterrows(): | |
| if node_a % KK_prints == 0: | |
| print(K) | |
| node_a_coord = list(row[:2]) | |
| ncns = [] |
This file contains hidden or 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
| function setLatLng(dataset) { | |
| var lat = dataset.lat | |
| var lng = dataset.lng | |
| return new L.LatLng(lat, lng) | |
| } | |
| function latLngRadians(dataset) { | |
| return _.map(dataset, function(item) { | |
| var latRad = item.lat*(Math.PI/180) | |
| var lngRad = item.lng*(Math.PI/180) |
OlderNewer