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 | |
MODsuff=MOD | |
MP4suff=mp4 | |
for src in `ls -d *.MOD` ; | |
do | |
dest=${src%.$MODsuff}.$MP4suff | |
echo Converting $src to $dest... | |
`./ffmpeg -i "$src" -s 720x405 -vcodec mpeg4 -b 2300k -deinterlace -strict -2 -aspect 16:9 -acodec aac -ab 192k -ar 44100 "$dest"` |
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') | |
http.createServer((req, res)=>{res.end(`Happy Monday America! | |
Your Node environment is ${process.env.NODE_ENV} | |
`)}).listen(80) |
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
sudo curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - | |
sudo yum -y install nodejs |
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 assert = require('assert') | |
const solution = (str) => { | |
const checkSubs = (s, oldResults=[]) => { | |
let start = s.indexOf('{') | |
let end = s.indexOf('}', start+1) | |
// console.log('yo', s, start, end,s.substring(end+1, s.length)) | |
if (start<0 && end <0) { | |
for (let i = 0; i<oldResults.length; i++) { | |
oldResults[i] += s |
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 port = 3000 | |
require('http') | |
.createServer((req, res) => { | |
console.log('url:', req.url) | |
res.end('hello world') | |
}) | |
.listen(port, (error)=>{ | |
console.log(`server is running on ${port}`) | |
}) |
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 port = 80 | |
require('http') | |
.createServer((req, res) => { | |
console.log('url:', req.url) | |
console.log('now we will slow down and block and consume CPU...') | |
for (var i=0; i< 100000000; i++) {} | |
res.end('hello world') | |
}) | |
.listen(port, (error)=>{ | |
console.log(`server is running on ${port}`) |
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 port = process.env.PORT || 3000 | |
require('http') | |
.createServer((req, res) => { | |
console.log('url:', req.url) | |
res.end('hello world') | |
}) | |
.listen(port, (error)=>{ | |
console.log(`server is running on ${port}`) | |
}) |
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 ReactDOM = require('react-dom') | |
const React = require('react') | |
const TimerButton = (props) => { | |
return ( | |
<button type="button" onClick={()=>{ | |
props.handler(props.time) | |
}}>Start {props.time}</button> | |
) | |
} | |
const TimerLabel = (props) => { |
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 express = require('express') | |
const logger = require('morgan') | |
let app = express() | |
const mongodb= require('mongodb') | |
const url = 'mongodb://localhost:27017/mean' | |
const bodyParser = require('body-parser') | |
app.use(bodyParser.json()) | |
mongodb.MongoClient.connect(url, (error, db)=>{ | |
if (error) return process.exit(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
alert('test'); |