Skip to content

Instantly share code, notes, and snippets.

View davidoster's full-sized avatar

David Oster aka George Pasparakis davidoster

View GitHub Profile
@davidoster
davidoster / index.html
Last active January 23, 2021 18:57
Playing around
<!DOCTYPE HTML>
<HTML>
<HEAD></HEAD>
<BODY>
<!-- doesn't work!!! <a href="" onclick='onDelete("http://localhost:3000/books/delete/1")'> Delete</a> -->
<button onclick='onDelete("http://localhost:3000/books/delete/1")'> Delete</button>
<SCRIPT>
function onDelete(url) {
var dialog = confirm("Are you sure you want to delete this book?");
if(dialog) {
@davidoster
davidoster / js_mistakes.md
Last active January 12, 2021 06:09
7 Mistakes I Made (and Regret) as JavaScript Developer

I made lots of mistakes while learning to code, actually terrible ones. I thought, why not warn everyone before they make the same. I am sure this will help you get on the fast track towards success.

  1. Learning it all at once

When I started to learn to program, I spent too much time learning different programming languages and frameworks at once. I spent a week with one technology and language, learning its basics and another the next week. I just kept on jumping from one thing to another. I bet many have and will commit this same mistake. Now I realise that was a dumb idea. I was learning multiple things at once, but I had no clear direction about what type of developer role I wanted to have. I was becoming general of everything instead of specialising, focusing my energy and time on one thing. Programming languages are just tools, and tools come with various shapes an

/// <summary>
/// Get all Greek holidays for requested year
/// </summary>
/// <param name="year">Year of holidays</param>
/// <returns>List of dates of all public holidays, except weekends</returns>
public static List<DateTime> GreekHolidays(int year)
{
var easter = GetOrthodoxEaster(year);
var holidays = new List<DateTime>();
@davidoster
davidoster / Java Hangman
Created September 26, 2020 19:32 — forked from adeelibr/Java Hangman
A simple command line game of Hangman made in Java
package Hangman;
import java.util.Scanner;
import java.util.Random;
public class Built {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
Random random = new Random();
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
int read(int fd, char *buf, int n);
int write(int fd, char *buf, int n);
int fstat(int fd, struct stat *st);
@davidoster
davidoster / dummy-web-server.py
Last active October 1, 2023 01:29 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@davidoster
davidoster / index.html
Created May 2, 2019 08:55
Simple Javascript Quiz
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> Computer Based Test</title>
<link rel="stylesheet" href="simplequiz/css/style.css">
<script src="file:///C:/Users/Orijajogunlo/Desktop/jquery-1.11.3.js"></script>
<script src="simplequiz/js/script.js"></script>
</head>
<body>
@davidoster
davidoster / README.md
Created November 6, 2018 05:54 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@davidoster
davidoster / README.md
Created November 6, 2018 05:24 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@davidoster
davidoster / create_koken.sh
Created October 26, 2018 04:04 — forked from bradleyboy/create_koken.sh
Docker script for Koken
#!/bin/bash
echo ""
# Root check
if [[ "$UID" -ne 0 ]]; then
echo "!! This script requires root privileges. sudo ./create_koken.sh"
echo ""
exit
fi