Random
-
MySQL Basics
add export PATH=$PATH:/usr/local/mysql/bin to ~/.bash_profile or /etc/profile
Backup database to text file
mysqldump database_name > database_name.sql
Remove database
mysql> drop database database_name;
Create database
mysql> CREATE DATABASE database_name;...
Code 2014
-
Fill array with server request URI strings
<?php
$request = explode( "/", $_SERVER["REQUEST_URI"] );
array_shift( $request );
print_r( $requests );
?>...
Code
Template Coding
PHP 2013
-
BossaNova Robotics
Robot Toy Product Promotion
Site Request Handler, Framework for loading XML content from Flash nav click. Flash, GoogleMaps and YouTube Embedding....
Stylesheet Coding
Template Coding
JavaScript
Work 2011
-
Make Drupal Module Most Important
So other modules don't supersede your module, run this code once.
<?php
db_query("UPDATE {system} SET weight = 100 WHERE name = 'MODULE_NAME'");
?>...
Code
Template Coding
Drupal 2013
-
Login redirect
<?php
function HOOK_user_login_submit( $form, &$form_state ){
$form_state["redirect"] = "";
}
function HOOK_form_user_login_alter( &$form, $form_state ){
$form["#submit"][] = "HOOK_user_login_submit";
}
?>...
Code
Template Coding
Drupal 2013
-
Various WP snippets
Show Links Menu w/Active Class
<nav>
<?php $args=array(
'sort_order' => 'ASC',
'sort_column' => 'post_date',
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'meta_key' => '',
'meta_value' => '',
'authors' => '',
'child_of' => 0,
'parent' => -1,
'exclude_t...
Code
Template Coding
Wordpress 2013
-
In the Weeds
Restaurant Management Tool
Stylesheet Coding
JavaScript
Work 2016
-
Jellyfish Frequency
Record Label Website
Work
Template Coding
Information Structuring
Stylesheet Coding
Drupal 2012
-
IAS
Data Management Services Promotion
Salesforce Form Submission Connectivity, AJaX Content Filtering, Flash Video Embedding...
Stylesheet Coding
Information Structuring
Template Coding
JavaScript
Work
Drupal 2011
-
Business Researchers
Business Strategy Services Information
Layout & Typography, Site Template & Request Handler, Animated Dropdown Menus, Google Maps Embed, Flash Embed See also: businessresearchers.com...
Work
Stylesheet Coding
Template Coding
JavaScript 2010
-
Render imagecache images
echo( "<img src=\"".image_style_url("thumbnail", $photo["uri"] )."\" alt=\"\"/>" );...
Code
Template Coding
Drupal 2013
-
La Picolla Scolla Italia
Italian Preschool Information
Layout & Typography, Semantic XHTML content structuring, Site Template & Request Handler, Flash & GoogleMaps Embedding...
Stylesheet Coding
Information Structuring
Template Coding
JavaScript
Work 2013
-
Obtain matching entities
function obtain_entities_by_type($entity_type,$bundle,$limit=10,$offset=0,$subject_nid=FALSE){
$query=new EntityFieldQuery();
$query->entityCondition('entity_type', $entity_type)
->entityCondition('bundle', $bundle)
->propertyCondition('status', 1)
->range($offset, $limit...
Code
Template Coding
Drupal 2013
-
Create symlinks
<?php
symlink('/homepages/21/d93015512/htdocs/library/organic_connectivity',
'/homepages/21/d93015512/htdocs/drupal/sites/all/modules/organic_connectivity/lib');
?>...
Code
Information Structuring
PHP 2014
-
Organic Interfaces
Portfolio Website
Work
Information Structuring
Template Coding
Stylesheet Coding
Graphic Design
Drupal
Organic Connectivity Module 2011
-
Post referencing setup
Assign multiple disciplines to a project
<?php
// Adds custom post type for Projects and Services
function create_post_type(){
register_post_type('project',
array(
'labels' => array(
'name' => __('Projects'),
'singular_name' => __('Project')
),
'taxonomies' => array('category'),
'public...
Code
Wordpress 2016
-
Show field when a different selection is made on the same form
function HOOK_form_alter( &$form, &$form_state, $form_id ){
if( $form_id == "user_register_form" || $form_id == "user_profile_form" ) {
// Shows OTHER text field when 'Other' is selected as their specialty
$form["field_specialty_other"]["#states"] = array(
"visible" => arr...
Code
JavaScript
Template Coding
Drupal 2013
-
Image Desaturation Effect
.box img{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'>
<filter id=\'grayscale\'>
<feColorMatrix type=\'saturate\' values=\'0.5\'/>
</filter>
</svg>#grayscale");
filter: gray alpha(opacity=50);
-webkit-filter: grayscale(50%);
-webkit-transfo...
Stylesheet Coding
Code 2013
-
Webcam Image Refresher
HTML
<img src="http://orgnsm.org/camoff.jpg" alt="Webcam" id="webcamImage"/></div>
JavaScript
function refreshCam(id, file) {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
document.getElementById(id).src = file + "?time="+h+m+s;
setTime...
JavaScript
Code 2013
-
Using jQuery flexslider with animated captions callback
jQuery(window).load(function(){
jQuery('.flexslider').flexslider( {
pauseOnHover: true,
controlsContainer: ".flex-container",
slideshowSpeed: 8000,
before: function(slider){
var currentSlide = slider.slides.eq(slider.currentSlide);
jQuery(currentSlide...
Code
JQuery 2014
-
Incubator
Artwork Project Archive
Typography & Layout, Content Structuring, UI/X Design, Interactivity & Sorting...
Work
Stylesheet Coding
Information Structuring
Graphic Design
Template Coding
JavaScript
Drupal
Organic Connectivity Module 2013
-
Slideshow
HTML
<div id="photos_rotator">
<ul>
<li>
<a href="/node/15">
<span class="title">003</span>
</a>
<div class="rotator_full"><img src="003_0.jpg" alt=""/></div>
</li>
<li>
<a href="/node/14">
<span class="t...
JavaScript
Stylesheet Coding
Code
JQuery 2013
-
Rate Your Customer / Rate My Contractor
Work
Wordpress
Stylesheet Coding
PHP 2015
-
Insert email as username at registration
<?php
function HOOK_user_insert( &$edit, &$account, $category = NULL ){
// Don't create a new username if one is already set
if( strpos($account->name, 'temporary_') !== 0)
return;
// Otherwise, replace username with email address field
db_update("users")
->fields(array(...
Code
Template Coding
Drupal 2013
-
Organic Planner
Private Notes & Organizational Tools
...
Work
Template Coding
Information Structuring
Stylesheet Coding
Drupal
Organic Connectivity Module
Graphic Design 2010