View this code at http://livecoding.io/3710495
This file contains 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
const form = new FormData(); | |
const url = 'https://i.ytimg.com/vi/20u8EOBbmSk/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBKHG0GyzmzLNJ-04e5KSIcXCJtBQ' | |
// Get an image from YouTube and return arraybuffer or stream | |
const getImageStream = await axios.get(`${url}`, { responseType: "arraybuffer" }) | |
.then(async (data)=>{ | |
const buffer = Buffer.from(data, 'binary') | |
/* // Doesn't work | |
// Get error: "Error: Input buffer has corrupt header:" |
This file contains 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
#!/bin/bash | |
# Functions ============================================== | |
# return 1 if global command line program installed, else 0 | |
# example | |
# echo "node: $(program_is_installed node)" | |
function program_is_installed { | |
# set to 1 initially | |
local return_=1 |
This file has been truncated, but you can view the full file.
This file contains 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
Last login: Wed Apr 18 10:10:47 on ttys011 | |
MacBook-Pro:mobile_2018_04_11 user$ adb logcat | |
--------- beginning of system | |
04-18 03:29:49.545 613 651 E FrameworkListener: read() failed (Connection reset by peer) | |
04-18 03:29:51.505 1021 1511 I chatty : uid=1000(system) Binder:1021_3 expire 11 lines | |
04-18 03:29:52.212 1021 12702 I chatty : uid=1000(system) Binder:1021_20 expire 15 lines | |
04-18 03:29:54.316 613 31518 W SocketClient: write error (Broken pipe) | |
04-18 03:31:39.890 1661 1661 I chatty : uid=1001(radio) com.android.phone expire 39 lines | |
04-18 03:32:02.726 1021 6056 I chatty : uid=1000(system) Binder:1021_1D expire 13 lines | |
04-18 03:36:12.618 613 651 E FrameworkListener: read() failed (Connection reset by peer) |
This file contains 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
module.exports = options => { | |
if (options.mode == 'production'){ | |
return { | |
entry: 'src/index.js', | |
extractCSS: false, | |
filename: { | |
js: 'index.js' | |
}, | |
format: 'umd', |
This file contains 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 go() { | |
var userId = prompt('Username?', 'Guest'); | |
checkIfUserExists(userId); | |
} | |
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users'; | |
function userExistsCallback(userId, exists) { | |
if (exists) { | |
alert('user ' + userId + ' exists!'); |
This file contains 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
.ceil(_.random(1,5, true),2); //Generate Random numbers between 1 & 5 with precision of 2. ex: 4.56 |
This file contains 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
#page1:inactive #body-image-background { | |
opacity: 0; | |
background: url('image_page1.jpg') no-repeat cover cover; | |
-webkit-transition: all 1s ease-in-out; | |
-moz-transition: all 1s ease-in-out; | |
-o-transition: all 1s ease-in-out; | |
transition: all 1s ease-in-out; | |
} | |
#page1:active #body-image-background { |