Skip to content

Instantly share code, notes, and snippets.

@pakerchang
pakerchang / class_decorator.ts
Created May 27, 2023 17:09 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@pakerchang
pakerchang / README.md
Created February 14, 2022 06:37 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@pakerchang
pakerchang / answer1.md
Last active December 3, 2021 18:58
Oursky Developer Pre-Test

Question 1:

Write a function that takes two arrays as input, each array contains a list of A-Z; Your program should return True if the 2nd array is a subset of 1st array, or False if not.

Please explain the computational complexity of your answer in Big-O notation, i.e. O(log n) or O(n ^2)? For example:

isSubset([A,B,C,D,E], [A,E,D]) = true 
isSubset([A,B,C,D,E], [A,D,Z]) = false 
isSubset([A,D,E], [A,A,D,E]) = true