This file contains hidden or 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
docker pull eu.gcr.io/euphoric-adventures/uk-train-boards_ukrsib:latest; | |
docker stop ukrsib; | |
docker rm ukrsib; | |
docker run --name ukrsib --net routing -v ~/uktb/app:/var/www/htdocs/ -d eu.gcr.io/euphoric-adventures/uk-train-boards_ukrsib; | |
docker stop uk-train-boards_nginx; | |
docker rm uk-train-boards_nginx; | |
docker run --name uk-train-boards_nginx -p 10080:10080 --net routing -v ~/uktb/app:/var/www/htdocs/ -v ~/uktb/docker/nginx.conf:/etc/nginx/conf.d/default.conf -d nginx; | |
# docker tag uk-train-boards_ukrsib eu.gcr.io/euphoric-adventures/uk-train-boards_ukrsib:latest; |
This file contains hidden or 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
git branch | grep \* | cut -d ' ' -f2 |
This file contains hidden or 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
# . mkv.sh "xyz/BDMV/STREAM" "~/fs"; | |
cd "$1"; | |
for i in *.m2ts; do | |
mkvmerge -o "$2/$i.mkv" $i; | |
done | |
cd -; |
This file contains hidden or 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 kill -9 $(ps auxwww | grep MacOS/loginwindow | grep james | head -1 | tr -s " " | cut -d " " -f 2) |
This file contains hidden or 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 Hapi = require('hapi'); | |
const allowedOrigins = []; | |
const middleware = function addCorsHeaders (request, reply) { | |
// not cors | |
if (!request.headers.origin) { | |
return reply.continue() | |
} |
This file contains hidden or 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
'use strict'; | |
async function boot () { | |
async function getName () { | |
if (false) { | |
return new Promise( | |
resolve => { | |
setTimeout(() => resolve('James'), 1000); | |
} |
This file contains hidden or 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 | |
# output: id, name, age | |
DATABASE_PATH="database.db"; | |
TABLE_NAME="table"; | |
LIST=$(sqlite3 $DATABASE_PATH "PRAGMA table_info($TABLE_NAME)"); | |
for ROW in $LIST; do | |
printf $ROW | awk '{split($0,a,"|"); printf "%s, ", a[2]}'; | |
done |
This file contains hidden or 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
<!-- BASED ON https://codepen.io/2ne/pen/osvpj --> | |
<html> | |
<head> | |
<style> | |
.ios { | |
font-family: sans-serif; | |
line-height: 26px; | |
position: relative; | |
width: 500px; |
This file contains hidden or 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
"use strict"; | |
var fs = require("fs"); | |
let getLines = function getLines (filename, lineCount, callback) { | |
let stream = fs.createReadStream(filename, { | |
flags: "r", | |
encoding: "utf-8", | |
fd: null, | |
mode: 438, // 0666 in Octal |
This file contains hidden or 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
<html> | |
<head> | |
<title>Web Browser</title> | |
<style> | |
body { | |
margin: 24px; | |
} | |
.browser { | |
font-family: system, -apple-system, ".SFNSDisplay-Regular", "Helvetica Neue", "Lucida Grande", sans-serif; | |
font-size: 14px; |
NewerOlder