This file contains hidden or 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
| import React from 'react'; | |
| import { View } from 'react-native'; | |
| const MyPresentationalComponent = (props) => { | |
| return ( | |
| <View> | |
| {props.children} | |
| </View> | |
| ); | |
| }; |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { View } from 'react-native'; | |
| class MyComponent extends Component { | |
| render() { | |
| return ( | |
| <View /> | |
| ); | |
| } | |
| } |
This file contains hidden or 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
| function YOURTHEME_html_head_alter(&$head_elements) { | |
| // replace the meta content-type tag for Drupal 7 | |
| // http://www.metaltoad.com/blog/how-change-content-type-meta-tag-drupal | |
| $head_elements['system_meta_content_type']['#attributes'] = array( | |
| 'charset' => 'utf-8' | |
| ); | |
| } |
This file contains hidden or 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
| if (typeof Modernizr == 'object') { | |
| if (!Modernizr.touch) { | |
| console.log('Touch device'); | |
| } | |
| } |
This file contains hidden or 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
| if($form_id == 'views_exposed_form') { | |
| if($form['#id'] == 'views-exposed-form-view-display') { | |
| if (!isset($_GET['field']) || $_GET['field'] == '') { | |
| $default_value = 123; | |
| $form_state['input']['industry'] = $default_value; | |
| } | |
| } | |
| } |
This file contains hidden or 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
| $user_name_field = field_view_field('user', $user, 'field_name'); | |
| $user_name = render($user_name_field); | |
| //dsm($user_name); |
This file contains hidden or 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
| $user_name = ''; | |
| $user_name_items = field_get_items('user', $user, 'field_name'); | |
| if(!empty($user_name_items)) { | |
| $user_name_value = field_view_value('user', $user, 'field_name', $user_name_items[0]); | |
| $user_name = render($user_name_value); | |
| } | |
| //dsm($user_name); |
This file contains hidden or 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 | |
| // http://tylerfrankenstein.com/code/drupal-7-theme-image-style-example | |
| $image = theme( | |
| 'image_style', | |
| array( | |
| 'path' => 'public://my_example_image.jpg', | |
| 'style_name' => 'my_custom_image_style', | |
| 'alt' => 'Alternate Text', | |
| 'title' => 'Title Text', |
This file contains hidden or 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
| <div class="person person--male"> | |
| <div class="person__hand person__hand--right"></div> | |
| <div class="person__hand person__hand--left"></div> | |
| </div> | |
| <div class="person person--female"> | |
| <div class="person__hand person__hand--right"></div> | |
| <div class="person__hand person__hand--left"></div> | |
| </div> |
This file contains hidden or 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
| // Converts tracking to em, rem or px | |
| // Usage: | |
| // Em: p { letter-spacing: ls(-50); } | |
| // Rem: p { letter-spacing: ls(-50, 21, rem); } | |
| // Px: p { letter-spacing: ls(-50, 21, px); } | |
| $base-font-size: 16; | |
| @function ls($target, $context: $base-font-size, $unit: em) { | |
| @if ($unit == em) { |
NewerOlder