This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rgb2hex(rgb) { | |
var components = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); | |
function hex(x) { | |
return ("0" + parseInt(x).toString(16)).slice(-2); | |
} | |
return "#" + hex(components[1]) + hex(components[2]) + hex(components[3]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="col-xs-6"><div class="panel panel-info"><div class="media panel-heading"> | |
<div class="media-left media-middle"> | |
<img class="media-object" src="http://icons.wxug.com/i/c/k/mostlycloudy.gif"> | |
</div> | |
<div class="media-body"> | |
<h4 class="media-heading">29 ℉</h4>Muncie, IN</div> | |
</div></div></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
response: { | |
version: "0.1", | |
termsofService: "http://www.wunderground.com/weather/api/d/terms.html", | |
features: { | |
conditions: 1 | |
} | |
}, | |
current_observation: { | |
image: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myBluetoothDevice = { | |
adData: BluetoothAdvertisingData, | |
deviceClass: 7936, | |
id: "1gvrYl6VYpirzC34RDT8YA==", | |
instanceID: "1gvrYl6VYpirzC34RDT8YA==", | |
name: "Mip-89062", | |
productID: 0, | |
productVersion: 0, | |
uuids: Array[2], | |
vendorID: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lights": { | |
"1": { | |
"state": [null], | |
"type": "Extended color light", | |
"name": "Living Room 1", | |
"modelid": "LCT001", | |
"manufacturername": "Philips", | |
"uniqueid": "00:17:88:01:00:b4:28:11-0b", | |
"swversion": "66013452" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var ident = 'productId'; | |
var productView = { | |
get [ident] () { return true; }, | |
set [ident] (value) { } | |
}; | |
console.log( productView.productId ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var method = 'doIt'; | |
var productView = { | |
[method + "-001"]() { | |
console.log( "it's done!" ); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let salary = ['32000', '50000']; | |
[low, average, high = '90000'] = salary; | |
console.log( high ) | |
// 90000 | |
function reviewSalary([low, average], high = '90000') { | |
console.log( average ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let salary = { | |
low: '32000', | |
average: '50000', | |
high: '90000' | |
}; | |
let newLow, newAverage, newHigh; | |
({ low: newLow, average: newAverage, high: newHigh } = salary); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let [letter1, letter2] = 'AZ'; | |
console.log( letter2 ); | |
// 'Z' |