Skip to content

Instantly share code, notes, and snippets.

View gelinger777's full-sized avatar

Gelinger Media gelinger777

  • www.gelinger.at
  • Vienna
View GitHub Profile
@gelinger777
gelinger777 / nginx.conf
Created April 17, 2024 19:47 — forked from leeovery/nginx.conf
Modified Nginx configuration file for servers provisioned by Laravel Forge
# nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
user forge;
# How many worker threads to run;
# "auto" sets it to the number of CPU cores available in the system, and
# offers the best performance. Don't set it higher than the number of CPU
# cores if changing this parameter.
@gelinger777
gelinger777 / gist:0421cdddf5d8680f89fff0c22fecb8e8
Created November 19, 2023 21:31
Zammad Nginx Template for Laravel Forge
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/{{ SITE }}/before/*;
upstream zammad-railsserver {
server 127.0.0.1:3000;
}
<VirtualHost *:443>
ServerName lmkticket.amepheas.at
SSLEngine on
SSLCertificateFile /appl/apache2/ssl/apache-selfsigned.crt
SSLCertificateKeyFile /appl/apache2/ssl/apache-selfsigned.key
ServerAdmin you@your.address
ScriptAlias /cgi-bin/ "/appl/apache2/cgi-bin/"
ScriptAlias /amepheas/ "/appl/amepheas/bin/amepheas.fcgi/"
AddHandler fastcgi-script .fcgi
@gelinger777
gelinger777 / gist:6a87d5ab918fdfc558fdc9b963cfceb5
Created September 29, 2022 00:44
Nginx Allow only Cloudflare IPS
Create /etc/nginx/cloudflare.conf with following content
```
allow 173.245.48.0/20 ;
allow 103.21.244.0/22 ;
allow 103.22.200.0/22 ;
allow 103.31.4.0/22 ;
@gelinger777
gelinger777 / checkeuvat.py
Created May 30, 2022 10:52 — forked from kgaughan/checkeuvat.py
Checking an EU VAT number using the VIES SOAP interface
from suds.client import Client
client = Client('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl')
# Returns a dict-like object with the fields 'countryCode', 'vatNumber',
# 'requestDate', 'valid' (boolean), 'name', and 'address'.
result = client.service.checkVat('IE', '6390845P')
<style>
[data-custom-class='body'], [data-custom-class='body'] * {
background: transparent !important;
}
[data-custom-class='title'], [data-custom-class='title'] * {
font-family: Arial !important;
font-size: 26px !important;
color: #000000 !important;
}
[data-custom-class='subtitle'], [data-custom-class='subtitle'] * {
@gelinger777
gelinger777 / gist:f81e026d3040116a23caecd460add8d9
Last active October 28, 2021 20:10
AppsFlyer Ionic AppDelegate v3 (Only for SDK > 6.2.30) Works for Ionic Cordova >= 4
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@gelinger777
gelinger777 / gasp.py
Created December 3, 2020 21:36 — forked from iUmarov/gasp.py
# This is my implmentation of calculating Global Average Symmetric Price (GASP) as it's mentioned in this video: https://www.youtube.com/watch?v=wpmTuNvGQjQ
# Presenter in the video doesn't explain briefly how to calculate the GASP, but, I kinda figured it out myself
order_book = {
'bids': [
[97, 0.1],
[96, 0.2],
[95, 6]
],
@gelinger777
gelinger777 / influx_schema.sql
Created November 8, 2020 10:28 — forked from bbc4468/influx_schema.sql
Influx DB Schema for OHLC
create database price_history_db
CREATE CONTINUOUS QUERY "cq_1m" ON "price_history_db" BEGIN SELECT MIN(price) as low, MAX(price) as high, FIRST(price) as open, LAST(price) as close, SUM(size) as volume INTO "price_1m" FROM "trade" GROUP BY time(1m), symbol END
CREATE CONTINUOUS QUERY "cq_5m" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_5m" FROM "price_1m" GROUP BY time(5m), symbol END
CREATE CONTINUOUS QUERY "cq_15m" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_15m" FROM "price_5m" GROUP BY time(15m), symbol END
CREATE CONTINUOUS QUERY "cq_1h" ON "price_history_db" BEGIN SELECT MIN(low) as low, MAX(high) as high, FIRST(open) as open, LAST(close) as close, SUM(volume) as volume INTO "price_1h" FROM "price_15m" GROUP BY time(1h), symbol END
CREATE CONTINUOUS QUERY "cq_6h" ON "price_history_db" BEGIN SELECT
@gelinger777
gelinger777 / gist:ecf0e5fbbc879990b174a86b1cea40aa
Created June 6, 2020 13:46
GroceryCrudEnterpriseArmenianPart1.php
<?php
return [
'subject' => 'Տվյալ',
'subject_plural' => 'Տվյալներ',
'add_item' => 'Ավելացնել {subject}ը',
'edit_item' => 'Խմբագրել {subject}ը',
'view_item' => 'Բացել {subject}ը',
'edit' => 'Խմբագրել',
'view' => 'Բացել',