Skip to content

Instantly share code, notes, and snippets.

View BbsonLin's full-sized avatar
🏚️
Working...

Bobson Lin BbsonLin

🏚️
Working...
View GitHub Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
set nu
set cursorline
set expandtab
set tabstop=4
set shiftwidth=4
set mouse=a
" Color configuration
set bg=dark
hi LineNr cterm=bold ctermfg=DarkGrey ctermbg=NONE
@font-face {
font-family: octicons-link;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMA
@BbsonLin
BbsonLin / main.dart
Last active October 31, 2023 08:54
Flutter showDialog with return value
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@BbsonLin
BbsonLin / main.dart
Last active September 11, 2021 07:16
Dart handle characters/strings
List<int> hexToUnits(String hexStr, {int combine=2}) {
hexStr = hexStr.replaceAll(" ", "");
List<int> hexUnits = [];
for(int i = 0;i < hexStr.length;i+=combine) {
hexUnits.add(hexToInt(hexStr.substring(i, i+combine)));
}
return hexUnits;
}
int hexToInt(String hex) {
{
"vetur.validation.template": false,
"vetur.completion.scaffoldSnippetSources": {
"workspace": "💼",
"user": "🗒️",
"vetur": "✌"
},
"eslint.validate": ["vue", "html", "javascript"],
"prettier.disableLanguages": [],
"editor.formatOnSave": true,
@BbsonLin
BbsonLin / main.dart
Created February 27, 2019 08:10
Map.forEach usage
void main() {
Map<String, List> menuData = {
"food": [
{"title": "火腿堡", "price": 35.0, "count": 0},
{"title": "香雞堡", "price": 40.0, "count": 0}
],
"drink": [
{"title": "鮮奶茶", "price": 30.0, "count": 0},
{"title": "咖啡", "price": 35.0, "count": 0}
]
@BbsonLin
BbsonLin / index.html
Last active February 27, 2019 08:12
Coffee Shop
<h1>Coffee Shop</h1>
<h2>Food:</h2>
<ul id="foodlist"></ul>
<h2>Drink:</h2>
<ul id="drinklist"></ul>
import serial
import threading
import sys
import signal
import time
def quit(signum, frame):
print('')
print('stop fuction')