Skip to content

Instantly share code, notes, and snippets.

View matusmarcin's full-sized avatar

Matúš Marcin matusmarcin

View GitHub Profile
@matusmarcin
matusmarcin / deployer.sh
Last active November 26, 2017 22:14
My WP deployment script (runs on a server)
#!/bin/bash
MYSQLPWD='PWD-HERE-BECAUSE-I-AM-LAZY-TO-DO-BETTER'
echo "> "
echo "> I am about to deploy citajmesispolu.sk!"
echo "> "
read -p ">>> Press enter to continue..."
cd /mnt/v3-citajmesispolu/www && pwd
@matusmarcin
matusmarcin / settings.json
Last active October 11, 2017 19:49
VS Code settings
{
"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 13,
"workbench.welcome.enabled": false,
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "Monokai",
"window.zoomLevel": 0,
"vsicons.dontShowNewVersionMessage": true,
"editor.minimap.enabled": false,
"files.associations": {
@matusmarcin
matusmarcin / profile.json
Created October 8, 2017 17:38
iTerm2 profile
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0,
"Blue Component" : 1,
"Red Component" : 0
},
<ifModule mod_headers.c>
# Content Security Policy
# Content Security Policy (CSP) header not implemented
# This is what you should do, really:
# Header unset Content-Security-Policy
# Header set Content-Security-Policy "default-src 'self'"
#
# Below is what I had to do.
@matusmarcin
matusmarcin / mysql.md
Last active October 31, 2018 22:47
All MySQL CLI stuff I ever needed
CREATE DATABASE `db`;
CREATE USER 'matus'@'localhost' IDENTIFIED BY 'pwd';
GRANT ALL ON db.* TO 'matus'@'localhost';
@matusmarcin
matusmarcin / functions.php
Created November 30, 2015 14:48
My PHP improvement functions - very useful!
// Proper is_integer() check for dynamically typed PHP
// Yes, partly a joke.
function is_or_can_be_integer($value) {
return is_integer($value) || strcmp((string)(int)$value, $value) === 0;
}
// TODO
// Fix or wrap strpos() to return boolean.
// Fix all functions that use haystack needle or needle haystack params always in a different order.
<?php
error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', 1);
$_HTTP = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://';
// change this by country (gls-hungary.com, gls-slovakia.sk, gls-czech.com, gls-romania.ro, gls-slovenia.com, gls-croatia.com)
$wsdl_path = $_HTTP.'online.gls-slovakia.sk'.'/webservices/soap_server.php?wsdl&ver=14.11.03.01';
$client = new SoapClient($wsdl_path);
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management