Skip to content

Instantly share code, notes, and snippets.

View finwe's full-sized avatar

Matěj Humpál finwe

View GitHub Profile
#/bin/sh
# sudo apt install libxml2-dev libkrb5-dev libsqlite3-dev libbz2-dev libcurl4-openssl-dev libpng-dev libwebp-dev libjpeg-dev libgmp-dev libldap-dev libonig-dev libpq-dev libsodium-dev libargon2-dev libzip-dev
./configure --prefix=/home/finwe/php8.4 \
--enable-fpm \
--with-fpm-user=finwe \
--with-fpm-group=finwe \
--with-openssl \
--with-pcre-jit \
@finwe
finwe / failed_jobs.sql
Last active March 1, 2017 08:44
Laravel failed_jobs SQL for PostgreSQL
CREATE TABLE failed_jobs (
id SERIAL NOT NULL PRIMARY KEY,
connection text DEFAULT NULL,
queue text DEFAULT NULL,
payload text DEFAULT NULL,
exception text DEFAULT NULL,
failed_at timestamp(0) without time zone DEFAULT ('now'::text)::timestamp(0) with time zone NOT NULL
);
@finwe
finwe / nginx-configure.sh
Last active September 3, 2021 09:26
nginx ./configure parameters
#!/bin/bash
./configure \
--with-http_ssl_module \
--with-http_v2_module \
--sbin-path=/usr/local/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--user=www-data \
@finwe
finwe / date_interval.php
Created February 25, 2015 18:08
Czech date interval format
<?php
function date_interval(DateTime $begin, DateTime $end = NULL)
{
if (!$end) {
return $begin->format('j. n. Y');
}
$begin = array_reverse(str_split($begin->format('j. n. Y')));
$end = array_reverse(str_split($end->format('j. n. Y')));
@finwe
finwe / style.css
Created May 15, 2013 10:52
Make trello more compact
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("trello.com") {
body, input, select, textarea {
font: 13px/16px Calibri, "Helvetica Neue", Arial, Helvetica, sans-serif !important;
}
.list-card.active-card {
border-color: #AAA !important;
<?php
/**
* File operations wrapper class
*
* @author Finwe
*/
class File
{
@finwe
finwe / gist:4205225
Created December 4, 2012 15:36 — forked from dundee/.bashrc
Shows current git branch&status on command prompt
#GIT bash by HABR (modified by Dundee & Finwe)
export PSORIG="$PS1"
function gitbranch() {
branch="$(git branch 2>/dev/null | grep '*' | cut -d" " -f2-)"
dirty="$(git status -s 2>/dev/null)"
if [ -n "$dirty" ] ; then
color="1;33m"
else
color="0;33m"
@finwe
finwe / indexed_array_reduce.php
Created May 18, 2012 08:48
Array of mixed (usualy objects) to indexed array via array_reduce
<?php
array_reduce(
$objects, // array of objects, arrays...
function ($array, $item) {
$array[$item->getId()] = $item; // $item is current element
return $array; // $array is whole array that will be returned
},
array() // begin with empty array - strict standards
);
@finwe
finwe / gist:2421062
Created April 19, 2012 13:46
Annotations
<?php
private $knownAnnotations = array(
// phpdoc
'@param' => NULL,
'@var' => NULL,
'@return' => NULL,
'@author' => NULL,
'@license' => NULL,
'@see' => NULL,
<?php
return (int)("-" . Rand(100,999) . Rand(100,999) . Rand(100,999));