Skip to content

Instantly share code, notes, and snippets.

View Skarlso's full-sized avatar
:electron:

Gergely Brautigam Skarlso

:electron:
View GitHub Profile
@Skarlso
Skarlso / nginxproxy.md
Created April 10, 2017 13:16 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@Skarlso
Skarlso / map.cpp
Created February 20, 2017 13:11
Deleting Map Entry by function Pointer
#include <iostream>
#include <map>
#include <string>
#include <iterator>
#include <vector>
#include <functional>
/*
* Generic implementation to erase elements by Callback
@Skarlso
Skarlso / haproxy.cfg
Last active February 15, 2017 09:06
My haproxy config
global
daemon
# Set this to your desired maximum connection count.
maxconn 2048
# https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#3.2-tune.ssl.default-dh-param
# bit setting for Diffie - Hellman key size.
tune.ssl.default-dh-param 2048
defaults
option forwardfor
@Skarlso
Skarlso / haproxy.cfg
Created February 10, 2017 21:38 — forked from thisismitch/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@Skarlso
Skarlso / README.md
Created February 10, 2017 12:58 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications you can follow me @leonardofed


@Skarlso
Skarlso / README.md
Last active January 24, 2017 07:09
YouTube comment Downloader

Enalbe The following APIs here -> https://console.developers.google.com/apis/

  • Google+ API
  • YouTube Data API

Create a Project under Projects and Assign a credential for yourself. Download the credential file and put it into a file called client_secrets.json.

Install necessary libraries like this:

@Skarlso
Skarlso / command.class.php
Created January 17, 2017 09:07 — forked from cangelis/command.class.php
A simple Command Pattern implementation (Calculator example) on PHP
<?php
abstract class Command {
abstract public function unExecute ();
abstract public function Execute ();
}
class concreteCommand extends Command {
private $operator,$operand,$calculator;
public function __construct ($calculator,$operator,$operand) {
$this->operator = $operator;
$this->operand = $operand;
@Skarlso
Skarlso / aoc_2016_day1_part1.rb
Last active December 1, 2016 09:57
Advent Of Code 2016 Day 01
path = [[]]
file = File.open("input.txt")
contents = file.read
split = contents.split(", ")
split.each do |s|
m = s.match(/([L|R])(\d+)/)
l = m[1]
n = m[2]
path << [l, n.to_i]
end
// Copyright [2016] <Gergely Brautigam>
#include "./bob.h"
#include <boost/algorithm/string.hpp>
#include <string>
std::string bob::hey(std::string text) {
boost::trim_right(text);
if (text.empty()) {
return "Fine. Be that way!";
}
@Skarlso
Skarlso / wavdecode.go
Last active November 24, 2016 19:36
Decrypt Wav File
package main
import (
"fmt"
"io/ioutil"
"os"
)
var delimiter = [...]byte{96, 240, 96, 240}
var beatDelimiter = [...]byte{160, 15}