Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Marko Vujanic ultrox

🏠
Working from home
  • Germany, Mannheim
Block or report user

Report or block ultrox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ultrox
ultrox / @@INTRO.md
Created Aug 3, 2019 — forked from djmitche/@@INTRO.md
My use of Taskwarrior
View @@INTRO.md

Getting Started

My Usage

I've been using this for several years now, so here are some of the ways I have set it up to be most productive. See my taskrc below for implementation details.

In general, I've had the most success by keeping lists of tasks short and to the point, avoiding the anxiety of seeing 100 tasks and feeling like I'm going to drown.

@ultrox
ultrox / git-rmf
Last active Jun 26, 2019
Permanently remove any file from repository!
View git-rmf
#!/bin/bash
FILE=$1
if [[ -f $FILE ]]; then
git filter-branch -f --index-filter "git rm -r --cached $FILE --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all
else
echo File required
fi
@ultrox
ultrox / elon_musk_first_principles.md
Created Apr 30, 2019
How to think in first principles
View elon_musk_first_principles.md

First principles battery

  • what are the materials constituents of batteries

  • what is spot market value of the material constituents

  • Cobalt, nickel, aluminium, carbon and polymers for separation and steel can.

Break that down on a material basis and say okay if we bought that in London metal exchange, what would each of those things cost. Its $80 per kilowatt hour

View self-signed-certificate-with-custom-ca.md

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@ultrox
ultrox / webpack.config.babel.js
Created Oct 27, 2018
From how to build open source lib - Kent C. Dodds
View webpack.config.babel.js
//https://egghead.io/lessons/javascript-add-a-browser-build-to-an-npm-module
import { join } from "path";
export default {
entry: "./src/index.js",
output: {
path: join(__dirname, "dist"),
libraryTarget: "umd",
library: "starWarsNames"
},
View LearningSQLExample.sql
/* begin table creation */
create table department
(dept_id smallint unsigned not null auto_increment,
name varchar(20) not null,
constraint pk_department primary key (dept_id)
);
create table branch
(branch_id smallint unsigned not null auto_increment,
@ultrox
ultrox / ttfb.sh
Created Jan 2, 2018 — forked from sandeepraju/ttfb.sh
curl command to check the time to first byte
View ttfb.sh
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@ultrox
ultrox / default.conf
Created Dec 15, 2017 — forked from cbmd/default.conf
nginx config - dynamic virtual hosts
View default.conf
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@ultrox
ultrox / node-on-ec2-port-80.md
Created Aug 19, 2017 — forked from kentbrew/node-on-ec2-port-80.md
How I Got Node.js Talking on EC2's Port 80
View node-on-ec2-port-80.md

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);
@ultrox
ultrox / index.html
Created Nov 24, 2016
Simple Pure CSS Drop Down Menu
View index.html
<h1>Simple Pure CSS Drop Down Menu</h1>
<nav id="primary_nav_wrap">
<ul>
<li class="current-menu-item"><a href="#">Home</a></li>
<li><a href="#">Menu 1</a>
<ul>
<li><a href="#">Sub Menu 1</a></li>
<li><a href="#">Sub Menu 2</a></li>
<li><a href="#">Sub Menu 3</a></li>
<li><a href="#">Sub Menu 4</a>
You can’t perform that action at this time.