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, { useState } from 'react'; | |
| import useOnlineStatus from './useOnlineStatus'; | |
| const Example = () => { | |
| const [onlineStatus, setOnlineStatus] = useState(navigator.onLine); | |
| useOnlineStatus((isOnline) => { | |
| setOnlineStatus(isOnline); | |
| }); |
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
| const Handlebars = require('handlebars'); | |
| var source = `{{{{raw}}}} | |
| {{#if ready}} | |
| <p>Ready</p> | |
| {{/if}} | |
| <p>Something else!</p> | |
| {{{{/raw}}}}`; | |
| Handlebars.registerHelper('raw', function(content) { |
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
| { | |
| "01d": { | |
| "label": "Clear sky", | |
| "icon": "wi-day-sunny" | |
| }, | |
| "01n": { | |
| "label": "Clear sky", | |
| "icon": "wi-night-clear" | |
| }, | |
| "02d": { |
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 hook_watchdog(array $log_entry) { | |
| $severity_list = array( | |
| WATCHDOG_EMERGENCY => t('Emergency'), | |
| WATCHDOG_ALERT => t('Alert'), | |
| WATCHDOG_CRITICAL => t('Critical'), | |
| WATCHDOG_ERROR => t('Error'), | |
| WATCHDOG_WARNING => t('Warning'), | |
| WATCHDOG_NOTICE => t('Notice'), | |
| WATCHDOG_INFO => t('Info'), |
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 | |
| $entity_type = ''; | |
| $old_bundle = ''; | |
| $new_bundle = ''; | |
| $fields = array( | |
| 'field_name', | |
| ); | |
| foreach ($fields as $field) { |
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
| $field_name = ''; | |
| $entity_name = ''; | |
| $entity = entity_get_info($entity_name); | |
| foreach ($entity['bundles'] as $key => $value) { | |
| $field_instance = field_info_instances($entity_name, $key); | |
| $instance = $field_instance[$field_name]; | |
| field_delete_instance($instance); | |
| } |
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
| var StorageUnit = (function() { | |
| var is_supported = function() { | |
| try { | |
| return 'localStorage' in window && window['localStorage'] !== null; | |
| } catch (e) { | |
| return false; | |
| } | |
| }; | |
| var _ = window.StorageUnit = { |
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
| // Load plugins | |
| var gulp = require('gulp'), | |
| sass = require('gulp-ruby-sass'), | |
| autoprefixer = require('gulp-autoprefixer'), | |
| minifycss = require('gulp-minify-css'), | |
| jshint = require('gulp-jshint'), | |
| uglify = require('gulp-uglify'), | |
| imagemin = require('gulp-imagemin'), | |
| rename = require('gulp-rename'), | |
| clean = require('gulp-clean'), |
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
| jQuery.support.localstorage = function() { | |
| var mod = 'modernizr'; | |
| try { | |
| localStorage.setItem(mod, mod); | |
| localStorage.removeItem(mod); | |
| return true; | |
| } catch(e) { | |
| return false; | |
| } | |
| } |
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
| include_once DRUPAL_ROOT . '/includes/utility.inc'; | |
| $nodetype = ''; | |
| $instances = field_info_instances('node', $nodetype); | |
| $fields = array(); | |
| foreach ($instances as $instance) { | |
| unset($instances[$instance['field_name']]['id'], $instances[$instance['field_name']]['field_id']); |
NewerOlder