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
Func<string, string, string> action = new Func<string, string, string>((_, parameter) => | |
{ | |
string function(string x) | |
{ | |
Console.WriteLine(x); | |
return x; | |
} | |
_ = function(parameter); | |
return "whatever"; | |
}); |
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
import Foundation | |
public enum ShapeRawEnum: String, RawRepresentable { | |
case square | |
case circle | |
public var requestString: String { | |
return self.rawValue | |
} |
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
# positional, keyword or positional args - https://www.educative.io/answers/what-are-positional-only-arguments-in-python | |
# keyword-only args - https://peps.python.org/pep-3102/ | |
# kwargs - https://www.w3schools.com/python/gloss_python_function_arbitrary_keyword_arguments.asp | |
from typing import Optional | |
"""two | |
Function that demonstrates all kinds of required and optional arguments. | |
:keyword kwarg_optional: optional kwarg | |
""" |
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
const getPem = require('rsa-pem-from-mod-exp'); | |
const fetch = require('node-fetch'); | |
const jwt = require('jsonwebtoken'); | |
var keysUri = `https://login.microsoftonline.com/${process.env.AAD_TENANT_ID}/discovery/keys?appid=${process.env.AAD_CLIENT_ID}`; | |
fetch(keysUri, { redirect: 'manual' }).then(response => response.json()) | |
.then(data => { | |
var decodedToken = jwt.decode(token, { complete: true }); | |
var key = data.keys.find((_key) => _key.kid === decodedToken.header.kid); |
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
Admit it! | |
# TOP 10 | |
#1 Ninja Arashi series (1 & 2) | |
#2 Rusty Lake's Cube Escape series | |
#3 Eufloria HD | |
#4 Alto's series (Adventure & Odyssey) | |
#5 Ultraflow series (1 & 2) | |
#6 Lyne | |
#7 Prune |
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
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec | |
# or | |
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path$Installer; Start-Process -FilePath $Path$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path$Installer |
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
# Revert commit | |
git reset --hard <old-commit-id> | |
git push -f <remote-name> <branch-name> | |
# Refresh remote branches list | |
git remote update origin --prune | |
# Edit last commit message | |
git commit --amend |
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
# Add this to your YML file | |
install: | |
- cinst opencover.portable | |
- cinst codecov | |
test: off | |
test_script: | |
- ps: ./coverage.ps1 |
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
// This script shows how to use M language (Power Query Formula Language) | |
// to read data from GitHub API v4 using a POST request. | |
// This can come in handy when building PowerBI reports that utilize GraphQL endpoints for loading data. | |
let | |
vUrl = "https://api.github.com/graphql", | |
vHeaders =[ | |
#"Method"="POST", | |
#"Content-Type"="application/json", | |
#"Authorization"="Bearer <your_personal_token_here>" |
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
# Configure path to the root of your web project | |
$webRoot = "C:\inetpub\wwwroot\Kentico\CMS\" | |
$bin = $webRoot + "bin\" | |
# Load settings from web.config | |
[System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $webRoot + "web.config") | |
Add-Type -AssemblyName System.Configuration | |
[Configuration.ConfigurationManager].GetField("s_initState", "NonPublic, Static").SetValue($null, 0) | |
[Configuration.ConfigurationManager].GetField("s_configSystem", "NonPublic, Static").SetValue($null, $null) | |
([Configuration.ConfigurationManager].Assembly.GetTypes() | where {$_.FullName -eq "System.Configuration.ClientConfigPaths"})[0].GetField("s_current", "NonPublic, Static").SetValue($null, $null) |
NewerOlder