Skip to content

Instantly share code, notes, and snippets.

View dinowang's full-sized avatar
charging

Dino Wang dinowang

charging
View GitHub Profile
@dinowang
dinowang / standard.css
Created September 24, 2024 18:03
MARP
section {
background-image: linear-gradient(to bottom, #ffffff, #efefef);
justify-content: start;
}
section header {
background-color: #333;
padding: 8px 13px;
position: fixed;
top: -1px;
_update-az-extensions() {
remote_versions=$(az extension list-available --query "[?installed].{name:name, version:version}")
local_versions=$(az extension list --query "[].{name:name, installed_version:version}")
versions=$(jq -n --argjson local "$local_versions" --argjson remote "$remote_versions" '
[$local, $remote] |
transpose |
map({
name: .[0].name,
installed_version: .[0].installed_version,
@dinowang
dinowang / update-dotnet-tool.sh
Created November 17, 2023 04:51
Update all dotnet tool
#!/bin/bash
for t in $(dotnet tool list -g | awk 'NR>2 {print $1}');
do
dotnet tool update -g $t
done
@dinowang
dinowang / microsoft-docuemnts-language-switcher.js
Last active April 6, 2020 06:58
Microsoft docuemnts language (en-us/zh-tw/zh-cn) switcher
// ==UserScript==
// @name Microsoft docuemnts language (en-us/zh-tw/zh-cn) switcher
// @namespace http://dinowang.net/
// @version 0.1
// @description
// @author Dino Wang
// @match https://*.microsoft.com/*/*
// @match https://*.azure.cn/*/*
// @grant none
// ==/UserScript==
<?xml version="1.0" encoding="UTF-8"?>
<Landscape updated="2020-03-18T04:11:30Z" version="1" generator="SAP GUI for Windows v7600.1.4.154">
<Includes>
<Include url="https://gist.github.com/dinowang/b80427e0928c9b7f37d19095169d5980/raw/SAPUILandscapeGlobal.xml" index="0" />
</Includes>
<Workspaces>
<Workspace uuid="f390e047-d61a-414d-b543-020ccce3eef9" name="DEMO">
<Item uuid="3d789ef8-af5c-4d73-a62d-8f988e71bb39" serviceid="d94315fb-19c4-4d6f-8657-51cd73b842eb" />
</Workspace>
</Workspaces>
@dinowang
dinowang / search-engine-switcher.js
Last active March 16, 2020 14:41
Search engine (google | bing | duckduckgo) switcher for Tampermonkey
// ==UserScript==
// @name Search engine (google | bing | duckduckgo) switcher
// @namespace http://dinowang.net/
// @version 0.1
// @description
// @author Dino Wang
// @match https://*.google.com/search*
// @match https://*.google.com.tw/search*
// @match https://*.bing.com/search*
// @match https://duckduckgo.com/*
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using NPOI.HSSF.UserModel;
using NPOI.HSSF.Util;
az resource list | curl -H "Content-Type: application/json" -X POST -d @- http://localhost:5000/Home/Recv
@dinowang
dinowang / index.html
Last active October 9, 2018 13:03
whack-a-mole
<div id="game">
<div id="playground">
</div>
<div id="score">
<h2 class="text-danger">Scoreboard</h2>
<h3>
<span class="text-info">Your score: <span>
<span id="current-score" class="scores">0</span>
</h3>
<h3>
@dinowang
dinowang / StrToHex.cs
Last active June 20, 2018 09:15
C# convert string to hexadecimal string
var str = "1234中文";
var hex = string.Join("", Encoding.GetEncoding("BIG5").GetBytes(str).Select(x => $"{x:X2}"));
// hex = "31323334A4A4A4E5"