Skip to content

Instantly share code, notes, and snippets.

View szabacsik's full-sized avatar
🖖

András Szabácsik szabacsik

🖖
View GitHub Profile
@szabacsik
szabacsik / index.php
Created November 22, 2017 15:24
Hello World PHP script to testing my Ubuntu Apache PHP Docker Container
<?php
phpinfo();
@szabacsik
szabacsik / index.html
Created December 15, 2017 15:53
Blank HTML5 template with Bootstrap and JQuery framework
<!doctype html>
<html lang="en">
<head>
<title>Blank HTML5 template with Bootstrap and JQuery framework</title>
<meta charset="utf-8">
<meta name="description" content="Blank HTML5 template with Bootstrap and JQuery framework">
<meta name="author" content="András Szabácsik">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,800&amp;subset=latin-ext" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
@szabacsik
szabacsik / raw_post.php
Created January 8, 2018 14:18
Get raw data from the request body
$json_string = file_get_contents ( 'php://input' );
$object = json_decode ( $json_string );
var_export ( $object );
//http://php.net/manual/en/wrappers.php.php
//https://stackoverflow.com/questions/2731297/file-get-contentsphp-input-or-http-raw-post-data-which-one-is-better-to
@szabacsik
szabacsik / apache.conf
Last active January 23, 2018 10:27
Apache HTTP Server Configuration File for Docker Containerized Applications
#Apache HTTP Server Configuration File for Docker Containerized Applications
LogLevel debug
ErrorLog /proc/self/fd/2
CustomLog /proc/self/fd/1 combined
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /attached/artifact/public
LogLevel debug
@szabacsik
szabacsik / php.ini
Last active January 25, 2018 10:42
Additional php.ini file set in PHP_INI_SCAN_DIR environment variable, will be cloned on build and parsed from docker volume
display_startup_errors = On
display_errors = On
error_reporting = E_ALL
log_errors = On
max_input_time = 30
max_execution_time = 30
memory_limit = 256M
post_max_size = 25M
upload_max_filesize = 50M
date.timezone = "UTC"
@szabacsik
szabacsik / slack.php
Created January 29, 2018 12:07
slack php function
<?php
define ( 'SLACK_WEBHOOK', 'https://hooks.slack.com/services/' );
function slack ( $message, $username, $channel )
{
switch ( $channel )
{
case 'delivery-form':
$token = '...';
break;
}
@szabacsik
szabacsik / slack.sh
Created April 6, 2018 09:55
Post a message to a Slack channel with Curl
curl -X POST --data-urlencode "payload={\"channel\": \"#CHANNEL\", \"username\": \"USERNAME\", \"text\": \"MESSAGE\", \"icon_emoji\": \":frog:\"}" https://hooks.slack.com/services/TOKEN
@szabacsik
szabacsik / date.sh
Created May 26, 2018 08:01
bash date
TZ="UTC" date +'%Y%m%d.%H%M%S%3N'
TZ="Europe/Budapest" date +'%Y.%m.%d. %H:%M:%S.%3N'
@szabacsik
szabacsik / xdebug.ini
Last active July 7, 2018 07:36
xdebug configuration file
zend_extension="/usr/lib/php/20170718/xdebug.so"
xdebug.remote_port=9000
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_autostart=1
xdebug.idekey = PHPSTORM
xdebug.default_enable = 0
xdebug.profiler_enable = 1
;remember to change this to your local ip address
xdebug.remote_host=10.0.75.1
@szabacsik
szabacsik / bitbucket-pipelines.yml
Last active August 13, 2018 16:11
Simple build configurations to notify an api endpoint when a new commit pushed
image: php:7.2.7
pipelines:
default:
- step:
script:
- apt-get update && apt-get install -y --no-install-recommends jq
- export TOKEN=...
- export API=https://.../
- export TZ="Europe/Budapest"
- export TIME=$(date +'%Y.%m.%d. %H:%M:%S.%3N %Z')