This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
<?php | |
$link=mysql_pconnect($db['write']['host'],$db['write']['user'],$db['write']['pass']) or die ("Could not connect to datadase"); | |
mysql_select_db($db['write']['name']) or die ("could not select database"); | |
//patharray is an essentially an exploded $_SERVER['REQUEST_URI'] | |
//for articles rss feeds it would be /rss/articles/categoryname | |
//so $patharray[0]='rss', $patharray[1]='articles' and $patharray[2]='categoryname' | |
const('SITENAME','Example.com'); | |
const('WEBMASTER','[email protected] ([email protected])'); |
<?php | |
/** | |
* Implements hook_form_alter(). | |
*/ | |
function modulename_form_alter(&$form, &$form_state, $form_id) { | |
// You might want to filter by content type. | |
if ($form_id == 'ctype_node_form') { | |
// Add a cancel button. | |
$form['actions']['cancel'] = array( |
<?php | |
$lines = explode( "\n", file_get_contents( 'input.csv' ) ); | |
$headers = str_getcsv( array_shift( $lines ) ); | |
$data = array(); | |
foreach ( $lines as $line ) { | |
$row = array(); | |
foreach ( str_getcsv( $line ) as $key => $field ) |
<?php | |
// Machine name for our custom node | |
define('NODE_NAME', 'the_node_machine_name'); | |
// Machine name for our custom taxonomy | |
define('TAXONOMY_NAME', 'the_taxonomy_machine_name'); | |
function module_install() { | |
_create_taxonomy(); | |
_create_content_type(); | |
} |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.
If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.
[mysqld] | |
init_connect='SET collation_connection = utf8mb4_unicode_ci' | |
init_connect='SET NAMES utf8mb4' | |
character-set-server = utf8mb4 | |
character-set-client = utf8mb4 | |
collation-server = utf8mb4_unicode_ci | |
skip-character-set-client-handshake | |
innodb_file_format = Barracuda |