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 Acme\DemoBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
class AcmeCommand extends ContainerAwareCommand | |
{ |
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
This playbook has been removed as it is now very outdated. |
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 | |
# A simple script to backup an organization's GitHub repositories. | |
#------------------------------------------------------------------------------- | |
# NOTES: | |
#------------------------------------------------------------------------------- | |
# * Under the heading "CONFIG" below you'll find a number of configuration | |
# parameters that must be personalized for your GitHub account and org. | |
# Replace the `<CHANGE-ME>` strings with the value described in the comments | |
# (or overwrite those values at run-time by providing environment variables). |
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
//Duplicates Magic Field 2 meta data when using WPML to duplicate a post for translation | |
function duplicate_mf_meta($master_post_id, $target_post_id){ | |
global $wpdb; | |
$table = $wpdb->prefix.'mf_post_meta'; | |
$mf_metas = $wpdb->get_results("SELECT * FROM $table WHERE post_id = $master_post_id"); | |
foreach($mf_metas as $mf_meta){ | |
$master_meta_id = $mf_meta->meta_id; | |
$master_meta_value = $wpdb->get_var( $wpdb->prepare("SELECT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s LIMIT 1 OFFSET %d", $master_post_id, $mf_meta->field_name, $mf_meta->group_count - 1) ); //check since there may be multiple instances |
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
server { | |
listen 80; | |
server_name my-server.com; | |
access_log /var/log/nginx/my-server.com-access.log; | |
error_log /var/log/nginx/my-server.com-error.log; | |
root /var/www/my-server.com/public; | |
index index.php index.html; |
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 | |
/** | |
* AcmeTestBundle/Controller/AdminController.php | |
*/ | |
namespace Acme\TestBundle\Controller; | |
use eZ\Bundle\EzPublishCoreBundle\Controller; | |
/** | |
* Here is your Symfony controller, defined as a service (see service definition below) |
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 | |
# Generates this kind of thing: | |
# https://github.com/joelittlejohn/jsonschema2pojo/blob/master/CHANGELOG.md | |
# | |
# If your issue has 'breaking' label, the issue will be shown in the changelog with bold text | |
# | |
# All versions of this script are dedicated to the Public Domain, no rights reserved, | |
# as per https://creativecommons.org/publicdomain/zero/1.0/ | |
# | |
if [ "$#" -ne 2 ]; then |
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 Acme\TestBundle\Controller; | |
use eZ\Publish\Core\Pagination\Pagerfanta\ContentSearchAdapter; | |
use Pagerfanta\Pagerfanta; | |
use Symfony\Component\HttpFoundation\Response; | |
use eZ\Bundle\EzPublishCoreBundle\Controller; | |
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier; | |
use eZ\Publish\API\Repository\Values\Content\Query; |
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 | |
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB | |
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864` | |
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152` | |
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK | |
CACHEDIR="/Volumes/RamDiskCache/$USER" |
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 | |
# So you know whoami, but whereami? | |
# Relies on this handy hack <https://github.com/lindes/get-location> | |
latlong=$(/usr/local/bin/get-location 2> /dev/null \ | |
| sed -e 's/.*<\(.*\)>.*/\1/') | |
address=$(curl -Ss "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlong&sensor=false" \ | |
| grep formatted_address \ | |
| head -n 1 \ | |
| sed -e 's/[ \t]*"formatted_address" : "\(.*\)",/\1/') |
OlderNewer