Skip to content

Instantly share code, notes, and snippets.

View tangoabcdelta's full-sized avatar

tangoabcdelta

View GitHub Profile
@tangoabcdelta
tangoabcdelta / HackerRank.NodeJS.boilterplate.code.js
Created December 1, 2020 02:35
HackerRank NodeJS Boilterplate Code
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {
input_stdin += data;
});
@tangoabcdelta
tangoabcdelta / checkout and track in git.md
Last active January 12, 2021 17:09
some other commands in git
Checkout and track (1)
git fetch <remote-origin-name>

git checkout demo
Branch demo set up to track remote branch demo from origin.
Switched to a new branch 'demo'
(1a)
@tangoabcdelta
tangoabcdelta / reference.sublime-project
Created December 31, 2020 14:44
Sublime Project Settings File with several build_systems examples: reference.sublime-project
{
"folders": [{
"path": "src",
"folder_exclude_patterns": ["backup"],
"follow_symlinks": true
},
{
"path": "docs",
"name": "Documentation",
"file_exclude_patterns": ["*.css"]
@tangoabcdelta
tangoabcdelta / Sublime Helpers.md
Last active January 4, 2021 10:26
sublime and bash
# Launch sublime from bash command line

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl

Usage: subl [arguments] [files]         edit the given files
   or: subl [arguments] [directories]   open the given directories
   or: subl [arguments] -               edit stdin
@tangoabcdelta
tangoabcdelta / .editorconfig
Last active January 4, 2021 10:29
Much forgotten Editor Config file
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@tangoabcdelta
tangoabcdelta / installation-guide-nginx.md
Last active January 7, 2021 12:58
Installation Guide - nginx (with http2 support).md

Install nginx with http2 support on Ubuntu

  • Backup your nginx.conf files (usually under /etc/nginx/sites-available)
  • Remove old nginx - nginx incl. nginx-common: apt-get autoremove --purge nginx nginx-common
  • Add sources list for new nginx

Create /etc/apt/sources.list.d/nginx.list with the following content:

deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx
@tangoabcdelta
tangoabcdelta / 0. fundamentals.md
Last active January 11, 2021 21:34
nginx 101 - making nginx easy for you; easy-peasy-lemon-squeezy

Permissions

  • nginx starts with root permissions
  • that's because any process that requires to run below port 1024 needs elevated privileges
  • The TCP/IP port numbers below 1024 are special in that normal users are not allowed to run servers on them. This is a security feaure, in that if you connect to a service on one of these ports you can be fairly sure that you have the real thing, and not a fake which some hacker has put up for you.

Child Processes

  • but then the trouble arrives when nginx wants to limit the privileges (because, an unrestricted process can do a lot of damage, and this is why deno doesn't even have file systems permissions when it starts)
  • this is why nginx spawns several child processes
@tangoabcdelta
tangoabcdelta / 0. How to do this do that etcetera.md
Last active January 20, 2021 21:12
How to do this do, that etcetera
How to start / stop PostgreSQL from autostarting during start up - macOS
Disable/Enable PostgreSQL Autostart on Mac OS X Lion
  • save the following xml content in a com.edb.launchd.postgresql-9.1.plist
  • dump it in the correct directory
Dogfooding
  • Dogfooding is using an app or feature shortly before it's publically released.
  • The term dogfood comes from the expression "eating your own dogfood".
Fishfooding
  • Fishfooding is using an app or feature really early in its development before it's even really finished.
  • The term "fishfood" actually comes from the Google+ team inside of Google.
  • Google+ was internally codenamed Emerald Sea.
@tangoabcdelta
tangoabcdelta / get all git commits since last tag.md
Last active January 12, 2021 17:04
Get all git commits since last tag
TL;DR
# step 1: get all git commits since last tag
git log $(git describe --tags --abbrev=0)..HEAD --oneline`

# step 2: copy the output and paste in the message
git tag -a v1.0.2 -m "...paste here..."

or, do it in a single shot