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 | |
ffmpeg -f avfoundation -capture_cursor "1" -i "1" -pix_fmt yuv420p -r 25 out.mp4 | |
# CAPTURE CURSOR SHOULD BE SAME AS SCREEN INDEX | |
# USE THIS TO GET SCREEN INDEX: `ffmpeg -f avfoundation -list_devices true -i ""` |
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
(() => window.alert(1))(); |
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
// https://stackoverflow.com/a/10232330/10431732 | |
const childProcess = require('child_process'); | |
// just runs `ls -a ../` | |
const childp = childProcess.spawn('ls', ['-a', '../']); | |
// assign stdout to variable | |
const variable = chilldp.stdout; | |
// listen for events on that variable | |
variable.on('data', (data) => { | |
console.log('stdout: ' + data.toString()); |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func zzz(tme int) { | |
r := rand.Intn(10) |
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
/** | |
* | |
* Callback vs Promise demo | |
* | |
*/ | |
// A callback is nothing more than a parameter. | |
// Instead of accepting a string or object (or int, etc..), we accept | |
// a function instead. |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<div id="root"></div> |
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 http = require("http"); | |
const fs = require("fs"); | |
const fspath = require("path"); | |
const url = require("url"); | |
const server = http.createServer(async (request, response) => { | |
const path = url.parse(request.url).pathname; | |
switch (path) { | |
/** | |
* @route '/home' description for route |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<div id="root"></div> |
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 capsFirstLetter(str) { | |
if (typeof str !== "string") { | |
throw new Error("param `str` must be a string!"); | |
} | |
const firstLetterCaps = str[0].toUpperCase(); | |
const restOfString = str.slice(1); | |
return firstLetterCaps + restOfString; | |
} | |
const myStr = "something"; |