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
@bramus
bramus / isSunSup.php
Last active November 27, 2018 13:23
PHP: Is The Sun Up (standalone version)?
<?php
function sunIsUp(\DateTime $when, $lat, $lon): bool {
$whenTimestamp = $when->getTimestamp();
$sunriseTimestamp = date_sunrise(
$whenTimestamp,
SUNFUNCS_RET_TIMESTAMP,
$lat,
$lon
@calebporzio
calebporzio / SvgIcon.vue
Created February 19, 2018 19:08
SVG Icon Vue Component
<template>
<div class="inline-block" v-html="require('icon-' + this.icon + '.svg')"></div>
</template>
<style module>
.svg {
fill: currentColor;
height: 1em;
margin-top: -4px;
vertical-align: middle;
@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

@jeffochoa
jeffochoa / Response.php
Last active May 22, 2024 04:06
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@alexbonhomme
alexbonhomme / macosx-install-php-oracle-oci8-pdo_oci.md
Last active March 27, 2024 08:49 — forked from krisanalfa/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew
@tompec
tompec / bulma.blade.php
Last active September 10, 2020 20:33
Bulma blade template for Laravel 5.4 pagination
@if ($paginator->hasPages())
<nav class="pagination is-centered">
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</a>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="pagination-previous">Previous</a>
@endif
@if ($paginator->hasMorePages())
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next</a>
@hewerthomn
hewerthomn / install_oci8_ubuntu_16.04_php7.1.md
Created February 22, 2017 14:45
How to install OCI8 on Ubuntu 16.04 and PHP 7.1
@JeffreyWay
JeffreyWay / ex.blade.php
Created November 5, 2016 19:22
Blade Directive for SVG Icon.
<!-- Before -->
<svg class="icon is-active" xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16">
<path d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"/>
</svg>
<!-- After -->
@icon ('flame', 'is-success')
set nocompatible "be iMproved
so ~/.vim/plugins.vim "Vundle Plugins
syntax enable "Syntax highlighting
set number "Line numbers
set backspace=indent,eol,start "backspace should behave like every other editor.
let mapleader= ',' "The default leader is \, but a comma is much better
set tabstop=4
set shiftwidth=4
@dharma017
dharma017 / email-debugging-mailcatcher.md
Created September 14, 2015 05:21
Email Debugging with MailCatcher

#MailCatcher

MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface. Run mailcatcher, set your favourite app to deliver to smtp://127.0.0.1:1025 instead of your default SMTP server, then check out http://127.0.0.1:1080 to see the mail that's arrived so far.

Manually Installing MailCatcher

sudo apt-get install -y vim curl python-software-properties lynx nginx
sudo apt-get install -y php5-fpm php5-memcache memcached php-apc
sudo apt-get install -y build-essential libsqlite3-dev ruby1.9.3