- https://unused-css.com: Obvious
- http://www.sitepoint.com/building-custom-twig-filter-tdd-way/ - Twig filters
- http://www.sitepoint.com/complete-guide-reducing-page-weight/ -
- http://www.sitepoint.com/show-us-books-upgrademylibrary/ - Older books champ
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS - Activate CORS
- http://knpuniversity.com/blog/upgrading-symfony-2.7
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
/* | |
* Let Editors manage users, and run this only once. | |
*/ | |
function isa_editor_manage_users() { | |
if ( get_option( 'isa_add_cap_editor_once' ) != 'done' ) { | |
// let editor manage users | |
$edit_editor = get_role('editor'); // Get the user role |
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 | |
add_filter('widget_text', 'do_shortcode'); |
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
denominations_USD = [ | |
{ 'title': 'Hundred-dollar bill', 'count': 0, 'val': 10000 }, | |
{ 'title': 'Fifty-dollar bill', 'count': 0, 'val': 5000 }, | |
{ 'title': 'Ten-dollar bill', 'count': 0, 'val': 1000 }, | |
{ 'title': 'Five-dollar bill', 'count': 0, 'val': 500 }, | |
{ 'title': 'One-dollar bill', 'count': 0, 'val': 100 }, | |
{ 'title': 'Quarter', 'count': 0, 'val': 25 }, | |
{ 'title': 'Dime', 'count': 0, 'val': 10 }, | |
{ 'title': 'Nickel', 'count': 0, 'val': 5 }, | |
{ 'title': 'penny', 'count': 0, 'val': 1 } |
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
is_processing = false; | |
last_page = false; | |
function addMoreElements() { | |
is_processing = true; | |
$.ajax({ | |
type: "GET", | |
//FOS Routing | |
url: Routing.generate('route_name', {page: page}), | |
success: function(data) { | |
if (data.html.length > 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 bin/console doctrine:mapping:convert annotation ./src/AppBundle/Resources/config/doctrine/metadata/orm --from-database --force --filter="NombreDeTabla" |
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
<h2>ASCII Animation Editor/Viewer</h2> | |
<table style="margin-left:auto;margin-right:auto"> | |
<tr><td style="text-align:center"> | |
Enter the frames below, separated by "<code>=====</code>".</td> | |
<td style="text-align:center"> | |
<input type="button" value="Play the Animation" onclick="PlayAnimation();"> | |
</tr> | |
<tr><td><textarea id="frameArea" rows=25 cols=55 style="font-size:8pt"> |
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/sh | |
now="$(date +'%d_%m_%Y_%H_%M_%S')" | |
filename="db_backup_$now".gz | |
backupfolder="/home/ubuntu/backups" | |
fullpathbackupfile="$backupfolder/$filename" | |
logfile="$backupfolder/"backup_log_"$(date +'%Y_%m')".txt | |
echo "mysqldump started at $(date +'%d-%m-%Y %H:%M:%S')" >> "$logfile" | |
mysqldump --user=root --password=password --default-character-set=utf8 bd_vitekey_cloud | gzip > "$fullpathbackupfile" | |
echo "mysqldump finished at $(date +'%d-%m-%Y %H:%M:%S')" >> "$logfile" | |
echo "file permission changed" >> "$logfile" |
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 | |
UP=$(service mysql status|grep 'mysql start/running' | wc -l); | |
if [ "$UP" -ne 1 ]; | |
then | |
echo "MySQL is down."; | |
sudo service mysql start; | |
echo "MySQL has return"; | |
else | |
echo "All is well."; |