Skip to content

Instantly share code, notes, and snippets.

View jk195417's full-sized avatar

楊竑昕 jk195417

View GitHub Profile
@jk195417
jk195417 / example.js
Created March 31, 2018 04:33
redis sub example
var redis = require("redis");
// open connection
var redis_url = "redis://password@host:port"
var sub = redis.createClient(redis_url)
// subscribe channel test
sub.on("message", function (channel, message) {
console.log("sub channel " + channel + ": " + message);
});
-- 6-5-1
insert into Product(pNo, pName, unitPrice, category)
values('b10000', '總統之路', 300, 'Book' );
insert into Author(pNo, name)
values('b10000', '陳水扁');
insert into Member(mid, pid, name)
values('a00001', 'c1000000000', 'Mary');
insert into Browse(mid, pNo, browseTime)
values('a00001', 'b10000', to_date('2003-04-05:09:00:08', 'YYYY-MM-DD:HH24:MI:SS'));
var A = function() {}
A.prototype.value = 'a'
var B = function() {}
B.prototype = new A()
B.prototype.value = 'b'
new B().value // return 'b'
{
"size": {
"width": 2500,
"height": 843
},
"selected": false,
"name": "default",
"chatBarText": "功能選單",
"areas": [
{
def content_filter(content)
# remove url
content = content.gsub(URI::DEFAULT_PARSER.make_regexp(['http', 'https']), '')
# remove mentions
content = content.gsub(/[bB]\d+/, '')
# check not empty content
raise 'no content' if content.blank?
return content
end
@jk195417
jk195417 / DoubleLinkedList.ts
Last active February 19, 2024 16:02
leetcode 1642
class LinkNode<TValue> {
value: TValue;
prev: LinkNode<TValue> | null;
next: LinkNode<TValue> | null;
constructor(value: TValue) {
this.value = value;
}
}