Skip to content

Instantly share code, notes, and snippets.

View mazedlx's full-sized avatar
😊
Awesome awesomeness

Christian Leo-Pernold mazedlx

😊
Awesome awesomeness
View GitHub Profile
"[php]":{
"editor.rulers": [
{
"column": 80, // spacing of 1st column from left
"color": "#555" // orange, Go Vols!
},
],
}
@mazedlx
mazedlx / code128.php
Last active November 12, 2021 08:20
Code128 Checksum
<?php
const START = 'Ë';
const END = 'û';
const MOD = 103;
const OFFSET = 32;
const SPECIAL_OFFSET = 68;
const PACKAGE = '06';
function calcChecksum($value)
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('bootstrap/cache')
->exclude('node_modules')
->exclude('storage')
->in(__DIR__)
->notName('*.blade.php')
->notName('.phpstorm.meta.php')
->notName('_ide_*.php');
# Remap prefix 'C-b' to 'C-a'
unbind C-b # remove bind for C-b
set-option -g prefix C-a
bind-key C-a send prefix
# Create Panes: window splitting
# Split vertically
unbind %
bind | split-window -h # Prefix | to create vertical split
# Split horizontally
@mazedlx
mazedlx / self_signed_certs_for_wsl.md
Last active January 21, 2019 16:55
Fucking SSL for fucking WSL development machine

Fucking self-signed certs for a fucking WSL development machine using fucking NGINX

Create a fucking CA

Create a fucking private key

$ openssl genrsa -des3 -out myCA.key 2048

Create a fucking root cert

@mazedlx
mazedlx / gist:2a2b41ba358564a15351734cbb03e9d5
Created November 20, 2018 12:51
GoAccess command for mazedlx.net
zcat /var/log/nginx/access.log.*.gz | goaccess /var/log/nginx/access.log.1 \
/var/log/nginx/access.log \
--log-format=COMBINED \
-o /var/www/html/stats/index.html \
--ws-url=wss://stats.mazedlx.net:7890 \
--real-time-html \
--daemonize \
--ssl-cert=/etc/letsencrypt/live/mazedlx.net/fullchain.pem \
--ssl-key=/etc/letsencrypt/live/mazedlx.net/privkey.pem
@mazedlx
mazedlx / laravel_exoscale_service_provider.md
Last active March 7, 2023 16:45
Laravel S3 ServiceProvider for Exoscale

How To Use Laravel with Exoscale Storage (AWS S3 compliant)

Make a new service provider

$ php artisan make:provider ExoscaleServiceProvider

Edit the provider to look like this

@mazedlx
mazedlx / AllDepartmentsSelect.spec.js
Created June 21, 2018 12:03
AllDepartmentsSelect.spec.js
import { mount } from "@vue/test-utils";
import Component from "../../components/Article/AllDepartmentsSelect.vue";
describe("AllDepartmentsSelect", () => {
let $wrapper;
beforeEach(() => {
$wrapper = mount(Component);
});
@mazedlx
mazedlx / AllDepartmentsSelect.vue
Created June 21, 2018 12:02
AllDepartmentsSelect.vue
<template>
<div class="form-group" :class="{ 'has-error': hasError }">
<label class="col-md-3 control-label">Abteilung</label>
<div class="col-md-6">
<select id="department_id" class="form-control" v-model="departmentId" @change="setDepartment">
<option v-for="department in departments" :value="department.id" v-text="department.department" :key="department.id"></option>
</select>
</div>
</div>
</template>
@mazedlx
mazedlx / how_to_install_oci8_on_ubuntu_17.10_and_PHP_7.1.md
Last active February 21, 2024 10:05
How to install OCI8 on Ubuntu 17.10 and PHP 7.1

How to install OCI8 on Ubuntu 17.10 and PHP 7.1

This guide refers to Instantclient Version 12.2.0.1.0

Install Oracle Instant Client and SDK

Step 1

Download the latest Oracle Instant Client and SDK from the Oracle website (Yeah, fuck you Oracle, you need to create an account to download the files).

http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html