Feel free to contact me at [email protected] or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
Feel free to contact me at [email protected] or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
------------ | |
-- Basics -- | |
------------ | |
-- Get indexes of tables |
// This file was initially generated by Windows Terminal 0.11.1191.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 12, | |
// font family with optional fallbacks | |
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.8)', |
cat urls.txt | xargs youtube-mp4 {} | |
cat urls.txt | xargs zsh -c 'youtube-mp4 {}' | |
cat urls.txt | xargs $functions[youtube-mp4] {} | |
cat urls.txt | xargs zsh -c '$functions[youtube-mp4] {}' | |
cat urls.txt | parallel curl http://example.com/item/{}.tar ">" {}.tar |
This is a collection of scripts to restore a full GHTorrent MongoDB database from the dumps available
at http://ghtorrent-downloads.ewi.tudelft.nl
.
To do the restore:
Open a MongoDB terminal and run the createCollections.js
script to create the necessary collections.
You can block_compressor
to either snappy
or zlib
to make your databases compressed. I am using
none here, as I am using compression at the filesystem level.
Run restore-cummulative-dumps.sh
to restore the cummulative dumps. Wait 3-4 days.
import { getRepository, InsertResult } from "typeorm"; | |
/** | |
* Upsert for TypeORM on PostgreSQL | |
* Returns InsertResult object (contains ID) | |
* @param repo Repository | |
* @param {object | object[]} data Data to upsert. Can be object or array | |
* @param {string} primaryKey Name of column that is primary key | |
* @returns {Promise<InsertResult>} | |
*/ |
upstream web_backend{ | |
server 192.168.1.11:3000; | |
server 192.168.1.12:3000; | |
} | |
server { | |
listen 3000; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
CREATE OR REPLACE FUNCTION calculate_url_key_by_id() RETURNS trigger | |
LANGUAGE plpgsql AS | |
$$ | |
DECLARE | |
CHARS VARCHAR(62) := '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'; | |
BASE INTEGER := 62; | |
tempId INTEGER; | |
result VARCHAR(31); | |
r DOUBLE PRECISION; | |
q DOUBLE PRECISION; |