A Pen by Peter Chen on CodePen.
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
using System; | |
using System.Diagnostics; | |
using System.Threading; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Stopwatch stopWatch = new Stopwatch(); | |
stopWatch.Start(); |
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
# Encoding current path all asp file to ASCII | |
get-childitem -path *.asp -force | foreach-object { (get-content $_.fullname) | set-content $_.fullname } |
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
const http = require('http'); | |
// const BASIC_AUTH = 'xBasic'; // Use Custom Authorization Type to Prevent Browser Basic Auth Popup | |
const BASIC_AUTH = 'Basic'; | |
const USER_NAME = 'admin'; | |
const PASSWORD = 'admin'; | |
function unauthorizedRes(res) { | |
// res.statusCode = 400; // Use Status Code Except 401 | |
res.statusCode = 401; |
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
<!--#include file="../util/base64.asp"--><!--https://stackoverflow.com/a/506992--> | |
<!--#include file="../util/jsonObject.class.asp" --><!--https://github.com/rcdmk/aspJSON--> | |
<% | |
response.LCID = 1046 | |
Function AddGrafanaUser(grafanaUrl, basicAuth, orgName, userName, password, userRole) | |
Dim orgId | |
orgId = getOrgId(grafanaUrl, orgName, basicAuth) | |
If orgId = 0 then |
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
public static uint saveTwoUShortToSingleUInt(ushort low, ushort high) | |
{ | |
uint result = low; | |
result += (uint)high << 16; | |
return result; | |
} | |
public static Tuple<ushort, ushort> convertSingleUIntToTwoUShort(uint integer) | |
{ | |
ushort low = Convert.ToUInt16(integer & 0xFFFF); |
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 | |
var layers = [ | |
{ | |
name: "Project", | |
count: 1 | |
}, | |
{ | |
name: "Node", | |
count: 1 | |
}, |
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
# Add a Custom Function: https://blogs.technet.microsoft.com/heyscriptingguy/2006/11/21/how-can-i-add-a-function-to-a-windows-powershell-script/ | |
# create today logbook | |
# reference: https://routley.io/tech/2017/11/23/logbook.html | |
function lb { | |
$date = Get-Date -DisplayHint date -format yyyy-MM-dd; | |
code --new-window \logbook\$date.md | |
} |
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
using System; | |
namespace Question3 | |
{ | |
public class Class1 | |
{ | |
//要檢查的最大Fibonacci的N, 題目為60 | |
private static int MAXNOFFIBONACCI = 60; | |
public int[] nextFibonacci(int[] numArray) |
NewerOlder