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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="test" default="test"> | |
<property name="dir" value="../test_directory" /> | |
<target name="test"> | |
<echo message="Test 1:" /> | |
<echo message="--------------------" /> |
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 | |
// Service Provider | |
$app->register(new Via\Content\ContentServiceProvider()); | |
// Route | |
$app->get('/{id}', function(Doctrine\DBAL\Connection $db) use ($app) { | |
return $app['content.id_checker']($db); | |
}); | |
// and in .... ContentServiceProvider |
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 | |
$file = 'data.csv'; | |
try { | |
$csv = new SplFileObject($file, 'r'); | |
} catch (RuntimeException $e) { | |
printf("Error opening .csv: %s\n", $e->getMessage()); | |
} |
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 | |
function flattenArray( array $array ) | |
{ | |
$returned_array = array(); | |
foreach( new \RecursiveIteratorIterator( new \RecursiveArrayIterator($array) ) as $key => $value ) | |
{ | |
$returned_array[] = $value; | |
} |
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 | |
function convertToSlug($input) | |
{ | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $input); | |
$text = trim($text, '-'); | |
$text = strtolower($text); | |
$text = preg_replace('~[^-\w]+~', '', $text); | |
return $text; | |
} |
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/bash | |
# Update packages | |
yum update | |
# Add some repos | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
# Install MySQL |
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
Starting php-fpm: | |
[06-Jun-2013 18:38:32] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0 | |
[ OK ] |
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/bash | |
function install_laravel() { | |
echo "Installing Laravel into '$project_name'..." | |
wget https://github.com/laravel/laravel/archive/master.zip ./ | |
unzip ./master.zip |
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 | |
/*********************************************** | |
Raw Data: | |
@$raw_data | |
Array | |
( | |
[0] => Array |
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
Q: Having problems with [usemin, grunt, useminprepare] not correctly renaming hook blocks in a [html, twig] template? | |
A: Check the motherfucking line endings of that file and ensure they are 'Unix'. | |
Q: Running a cron job and the script isn't firing? | |
A: Don't forget to check the PATH variable is imported at the top of the .sh file | |
Q: Having problems updating ModX directories (eg: core) and the /setup/ upgrade not working? | |
A: Make sure you replace the files/directories with the cp -R command and not Finder. Because Finder merge is weird and shit. |
OlderNewer