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.
| #!/bin/bash | |
| # This script creates a new project (or site) under /var/sites and creates | |
| # new virtual host for that site. With the options a site can also | |
| # install the latest version of Laravel directly. | |
| # This script was originally based on the following script by @Nek from | |
| # Coderwall: https://coderwall.com/p/cqoplg | |
| # Display the usage information of the command. | |
| create-project-usage() { |
| /* | |
| <a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
| - Or, request confirmation in the process - | |
| <a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
| */ | |
| (function() { |
| /**********************************************/ | |
| /* | |
| /* Based on Todd Werth's IR_Black: | |
| /* http://blog.toddwerth.com/entries/2 | |
| /* | |
| /* Inspired by Darcy Clarke's blog post: | |
| /* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
| /* | |
| /**********************************************/ |
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.
| function get_avatar_from_service(service, userid, size) { | |
| // this return the url that redirects to the according user image/avatar/profile picture | |
| // implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
| // for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
| // for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
| // for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
| // for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
| // for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
| // everything else will go to the fallback | |
| // google and gravatar scale the avatar to any site, others will guided to the next best version |