This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CompactFunction extends Twig_Extension | |
{ | |
/** | |
* @inheritdoc | |
*/ | |
public function getFunctions() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Find the mails you want to compress in a single maildir. | |
# | |
# Skip files that don't have ,S=<size> in the filename. | |
# | |
# Compress the mails to tmp/ | |
# | |
# Update the compressed files' mtimes to be the same as they were in the original files (e.g. touch command) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Laravel; defined('DS') or die('No direct script access.'); | |
/** | |
* The mcrypt library was deprecated in PHP7.2, so I couldn't run old Laravel 3.2 | |
* applications anymore. Rather than upgrade the whole application, you can just | |
* replace the `/laravel/crypter.php` file with this one, which uses the | |
* OpenSSL library instead of mcrypt. | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Providers; | |
use Elastica\Client; | |
use Illuminate\Support\ServiceProvider; | |
use Monolog\Formatter\LogstashFormatter; | |
use Monolog\Handler\ElasticSearchHandler; | |
class ElasticLoggingProvider extends ServiceProvider | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION VINCENTY( | |
lat1 FLOAT, lon1 FLOAT, | |
lat2 FLOAT, lon2 FLOAT | |
) RETURNS FLOAT | |
NO SQL | |
DETERMINISTIC | |
COMMENT 'Returns the distance in degrees on the Earth between two known points | |
of latitude and longitude using the Vincenty formula from: | |
http://en.wikipedia.org/wiki/Great-circle_distance' | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reducer = (max, elem) => { | |
const s = window.getComputedStyle(elem); | |
const z = parseInt(s.getPropertyValue('z-index'), 10) || 0; | |
return Math.max(max, z); | |
}; | |
const maxZ = Array.from(document.getElementsByTagName('*')) | |
.reduce(reducer, Number.MIN_SAFE_INTEGER); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# General | |
POWERLEVEL9K_MODE='nerdfont-complete' | |
POWERLEVEL9K_COLOR_SCHEME='dark' | |
# Prompts | |
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then | |
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir virtualenv vcs) | |
else | |
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator dir virtualenv vcs) | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013 | |
*/ | |
.select2-container { | |
margin: 0 0 1rem 0; | |
position: relative; | |
vertical-align: middle; | |
font-family: inherit; | |
-webkit-appearance: none !important; | |
font-size: 0.875rem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class :{ | |
public static function ()($x) { | |
return $x; | |
} | |
public static function rеturn ($x) { | |
echo $x; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CX="\033[0m" | |
CR="\033[31m" | |
CG="\033[32m" | |
CY="\033[33m" | |
FULL_VER=`php -r 'echo phpversion();'` | |
VER=`php -r 'echo phpversion();' | cut -d '.' -f1,2` | |
echo -e "${CY}Current PHP version:${CX} ${FULL_VER}"; |
NewerOlder