###What does it do?
Downloads the HD version of the Team Treehouse video you're currently watching.
###How to use:
- Right click on your bookmarks bar and choose
Add Page...
- Give it a name and paste the below code in the URL section
function copyToClipboard(text) { | |
const input = document.createElement('input'); | |
input.style.position = 'fixed'; | |
input.style.opacity = 0; | |
input.value = text; | |
document.body.appendChild(input); | |
input.select(); | |
document.execCommand('Copy'); | |
document.body.removeChild(input); | |
}; |
export function getContrastYIQ(color, colorType){ | |
let r, g, b; | |
const start = color.indexOf('#') === 0 ? 1 : 0; | |
if (colorType === 'hex') { | |
r = parseInt(color.substr(start, 2), 16); | |
g = parseInt(color.substr(start + 2, 2), 16); | |
b = parseInt(color.substr(start + 4, 2), 16); | |
} else if (colorType == 'rgb') { | |
[r, g, b] = color.slice(4, -1).split(',').map(str => +str); |
###What does it do?
Downloads the HD version of the Team Treehouse video you're currently watching.
###How to use:
Add Page...
# Disabling Notification Center | |
# “process not found” error shouldn't matter | |
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist | |
killall NotificationCenter | |
# Enabling Notification Center | |
launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist |
setInterval(displayTime, 1000); | |
function displayTime() { | |
var date = new Date(); | |
var h = date.getHours().toString(2); | |
var m = date.getMinutes().toString(2); | |
var s = date.getSeconds().toString(2); | |
h = fillStringLength(h, 5, '0'); | |
m = fillStringLength(m, 6, '0'); |
docker-machine regenerate-certs |
// Given: | |
var i = '1'; | |
// 1. What is the value of the below expression? | |
// 2. What is the value of `i` afterwards? | |
++i + +i+++i+i +++i+i+i+++i++ +i+++i; |
Theory:
your git repository can have more than one remote server; In this case we want to have two:
origin
)upstream
)How to make a private fork from github to gitlab
Updating Deep Immutable Object
let newVersion = {
language: 'Default Language', // Set default for unspecified properties
...previousVersion,
name: 'New Name', // Override the name property
address: {
...previousVersion.address,
zipCode: '99999' // Update nested zip code
},
###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791
For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt
file dtoverlay=dwc2
on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh
in the SD card as well. By default SSH is