next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt
for i in *.mp4; | |
do name=`echo "$i" | cut -d'.' -f1` | |
echo "$name" | |
ffmpeg -i "$i" -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 "${name}.webm" | |
done |
// | |
// main.c | |
// testQJS | |
// | |
// Created by menangen on 15/08/2019. | |
// Copyright © 2019 menangen. All rights reserved. | |
// | |
#include "quickjs.h" | |
#include "quickjs-libc.h" |
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
#!/usr/bin/env bash | |
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at: | |
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html | |
# | |
# As of May 21, 2019, this is: | |
# Amazon Linux AMI 2018.03.0 (ami-0756fbca465a59a30) | |
# | |
# You need to prepend PATH with the folder containing these binaries in your Lambda function | |
# to ensure these newer binaries are used. |
## Personal note: Muslims are not terrorists and I humbly request my engineering community to help end racism. | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart | |
# http://wiki.nginx.org/Configuration | |
# | |
# Generally, you will want to move this file somewhere, and start with a clean | |
# file but keep this around for reference. Or just disable in sites-enabled. | |
# |
I was poking around trying to figure out all the packages I have access to publish and got curious. So I write this little script to determine the download stats for all the packages I have publish access to.
Feel free to try it yourself. Just change the username passed to getUserDownloadStats
.
By default, the stats are sorted by their average daily downloads (descending). That should give you an idea of the most "popular" package of a given user relative to how long that package has been around.
You can use it with npx
like so:
This gist assumes:
www-data
(may be apache
on other systems)<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Add React in One Minute</title> | |
</head> | |
<body> | |
<h2>Add React in One Minute</h2> | |
<p>This page demonstrates using React with no build tooling.</p> |
const {createServer} = require('http'); | |
const {promisify} = require('util') | |
const hostname = '127.0.0.1'; | |
const port = 3000; | |
const server = createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('Hello World'); |