Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| // Switch architecture if needed | |
| if(2147483647 == PHP_INT_MAX) { | |
| $architecture = 'i386'; | |
| }else{ | |
| $architecture = 'amd64'; | |
| } | 
| <?php | |
| namespace Acme\BlogBundle\Tests\Controller; | |
| use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
| class DefaultControllerTest extends WebTestCase | |
| { | |
| public function testIndex() | |
| { | 
| class PID(object) : | |
| def __init__(self, temp_probe, target) : | |
| self.temp_probe = temp_probe | |
| self.samples = [] | |
| self.target = target | |
| GPIO.setup(CHILLPIN, GPIO.OUT) | |
| self.pid_ts = None | |
| self.events = [] | |
| GPIO.output(CHILLPIN, False) | 
| # Remote Server | |
| useradd www-deploy -c "Deployment User" -d /home/www-deploy -G www-data -m -s /bin/bash | |
| sudo su - www-deploy | |
| # Localhost | |
| ssh-keygen -t rsa | |
| # Append your key to the Remote host authorized keys file | |
| cat id_rsa.pub >> ~/.ssh/authorized_keys | 
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| perl -p -i -e 's/oldstring/newstring/g' `find ./ -name "*.html"` | 
| <?php | |
| /** | |
| * Symfony admin generator test template | |
| * @see https://gist.github.com/1304240 | |
| */ | |
| /** | |
| * The model name | |
| */ | |
| $model = 'ModelName'; | 
| #!/usr/bin/env python -tt | |
| import time | |
| import random | |
| OMGBUSY = """ | |
| >> execute: Splitting up dataset, running from {0} to {1} | |
| >> routingPattern Connect route "taggable_add_tag" (/admin/addTag/:object_class/:object_id) | |
| >> routingPattern Connect route "taggable_remove_tag" (/admin/removeTag/:object_class/:object_id) | |
| >> routingPattern Connect route "prestaSitemap_index" (/sitemap.xml) | 
By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.
Could be modified to be more advanced (match regular expressions to answer questions, etc.)
Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa
Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1
| <?php | |
| // Register an app: http://dev.twitter.com/apps | |
| define('CONSUMER_KEY', 'YOUR CONSUMER KEY'); | |
| define('CONSUMER_SECRET', 'YOUR CONSUMER SECRET'); | |
| define('TWITTER_TOKEN', ''); | |
| define('TWITTER_TOKEN_SECRET', ''); | |
| $oauth = new OAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI); |