Skip to content

Instantly share code, notes, and snippets.

View ar2rsawseen's full-sized avatar
🏠
Working from home

Arturs Sosins ar2rsawseen

🏠
Working from home
View GitHub Profile
@jlai
jlai / webos-ss-client.js
Last active July 13, 2020 11:24
Example nodejs code for connecting to a webOS Smart TV
/*
* Copyright (c) 2014 LG Electronics.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"