General usage ubuntu comments. Separated in general and development related.
General scope useful commands
- Sync VM machine time
sudo ntpdate ntp.ubuntu.com
Short practical guide to clarify the use cases of Decorators (aka HOF) and High Order Components. The examples is applicable for general JS, but are contructed using ES2015 + React.
Higher Order Functions (HOF) are functions that receive functions as arguments (Inception :/) and return functions. They operate over functions instead of "simple" variables. Decorators provide syntactic suggar for implementing HOFs JS, to modify and extend passed functions.
Higher Order Components (HOC) are a React specific patter, very much similar to the aforemntioned HOF. Instead of receiving functions as argumnets, Components are passed. They are especially useful to add stateful wrappers to componets and alter livecycle
; Global settings for redshift | |
[redshift] | |
; Set the day and night screen temperatures | |
temp-day=5300 | |
temp-night=3500 | |
; Enable/Disable a smooth transition between day and night | |
; 0 will cause a direct change from day to night screen temperature. | |
; 1 will gradually increase or decrease the screen temperature. | |
transition=1 |
{ | |
"window.title": "${dirty} ${activeEditorMedium}${separator}${rootName}", | |
"editor.formatOnPaste": true, | |
"editor.fontFamily": "Operator Mono", | |
"terminal.integrated.fontFamily": "Fira Code", | |
"terminal.integrated.fontSize": 14, | |
"terminal.integrated.lineHeight": 1.5, | |
"editor.fontSize": 18, | |
"editor.renderWhitespace": "boundary", | |
"editor.autoIndent": true, |
:100000000C94C3030C94E0030C94E0030C94E00301 | |
:100010000C94E0030C94E0030C94E0030C94E003D4 | |
:100020000C94E0030C94E0030C942C2B0C94FE2B0A | |
:100030000C9492230C94E0030C94E0030C94E003E2 | |
:100040000C94E0030C94E0030C94E0030C94E003A4 | |
:100050000C94E0030C94FA230C94E0030C94E0035A | |
:100060000C94E0030C94E0030C94E0030C94E00384 | |
:100070000C94E0030C94E0030C94E0030C94E00374 | |
:100080000C94E0030C94E0030C94E0030C94E00364 | |
:100090000C94E0030C94E0030C94E0030C94E00354 |
const INVALID = -1; | |
const binarySearch = (target, arr) => { | |
const start = 0; | |
const finish = arr.length - 1; | |
const middle = Math.floor((start + finish) / 2); | |
console.log(arr); | |
console.log('middle value: ',arr[middle]); | |
(async () => { | |
const got = require("got"); | |
const publicIp = require("public-ip"); | |
// get public ip | |
const publicIpV4 = await publicIp.v4(); | |
// get location from ip | |
try { | |
const response = await got(`http://ip-api.com/json/${publicIpV4}`); |