Skip to content

Instantly share code, notes, and snippets.

View re4388's full-sized avatar
🎯
Focusing

re4388 re4388

🎯
Focusing
  • Taipei,Taiwan
View GitHub Profile
@re4388
re4388 / re1.ts
Last active September 14, 2022 07:13
work-snippet1
public setSelectedRow(
event: MouseEvent | KeyboardEvent,
rowTag: string,
// turnOffEditable: boolean = true
): void {
// 1. unselected if select again (this.selectedRow === rowTag)
this.selectedRow = this.selectedRow === rowTag ? null : rowTag;
// 2. refer to dicomEditModalShortcut component
this.selectedElement$.next(<HTMLElement>event.currentTarget);
function helloWord(arg1, collectionUID){
console.log(collectionUID); // undefined
collectionUID = "222"
console.log(collectionUID); // 222
try {
console.log(arg1)
console.log(collectionUID)
throw new Error("oh no")
} catch (error) {
const promise = new Promise((resolve, reject) => {
console.log(1);
resolve(5);
console.log(2);
}).then(val => {
console.log(val);
});
promise.then(() => {
console.log(3);
@re4388
re4388 / asd.py
Created January 30, 2022 06:24
final1.py
import socket
import struct
import telnetlib
HOST = "192.168.1.111"
PORT = 2994
s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s1.connect((HOST, PORT))
@re4388
re4388 / index.js
Last active August 29, 2021 04:05
Export @code Extensions to a Markdown List (borrow from https://gist.github.com/elijahmanor/7f9762a4c2296839ad33e33513e88043)
#!/usr/bin/env node
const { exec } = require("child_process");
exec("code --list-extensions", (err, stdout) => {
if (err) { return; }
const markdown = stdout.split("\n").filter( e => e ).map(extension =>
`* [${extension}](https://marketplace.visualstudio.com/items\?itemName\=${extension})`
).join("\n");
console.log(markdown);
});
export enum PreprocessStatus {
COMPLETE = 'complete',
INCOMPLETE = 'incomplete',
}
export type NA = 'NA';
/**
* SeriesRemoteCacheStatus for Series level
*/
@re4388
re4388 / profile.ps1
Created March 24, 2021 07:46
Powershell Script
using namespace System.Management.Automation.Host
Add-Type -AssemblyName System.Device #Required to access System.Device.Location namespace
function get-weather{
$GeoWatcher = New-Object System.Device.Location.GeoCoordinateWatcher #Create the required object
$GeoWatcher.Start() #Begin resolving current locaton
@re4388
re4388 / dabblet.css
Created August 26, 2020 01:53 — forked from csssecrets/dabblet.css
Inner rounding
/**
* Inner rounding
*/
div {
outline: .6em solid #655;
box-shadow: 0 0 0 .4em #655; /* todo calculate max of this */
max-width: 10em;
border-radius: .8em;
@re4388
re4388 / dabblet.css
Created August 26, 2020 01:52 — forked from csssecrets/dabblet.css
Horizontal stripes
/**
* Horizontal stripes
*/
background: linear-gradient(#fb3 50%, #58a 0);
background-size: 100% 30px;
@re4388
re4388 / dabblet.css
Created August 26, 2020 01:52 — forked from csssecrets/dabblet.css
Vertical stripes
/**
* Vertical stripes
*/
background: linear-gradient(to right, #fb3 50%, #58a 0);
background-size: 30px 100%;