This file contains 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 | |
/** | |
* Calculate maximum nesting depth of parentheses. | |
* | |
* @see https://www.youtube.com/watch?v=zrOIQEN3Wkk | |
* @see https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/ | |
*/ | |
$input = '(1+(2*3)+((8)/4))+1'; |
This file contains 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 | |
/** | |
* Example enum usage. | |
* | |
* PHP8.1 will introduce the enum keyword, it will negate the need for the of | |
* validation code we often see below as enum will "make invalid states | |
* unrepresentable" | |
* | |
* @see https://wiki.php.net/rfc/enumerations |
This file contains 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 | |
$variables['blog_post']['teaser_image'] = []; | |
$variables['blog_post']['thumb_image'] = []; | |
/** @var NodeInterface $node */ | |
if ($node->hasField('field_hero_image')) { | |
/** @var \Drupal\Core\TypedData\ListInterface $fieldHeroImage */ | |
$fieldHeroImage = $node->get('field_hero_image'); |
This file contains 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
;;;; Demonstrate SBCL save-lisp-and-die. | |
;;; The characters of the Magic Roundabout are on the Magic Roundabout... on | |
;;; each execution of this program, the roundabout is *rotated* one place and | |
;;; the name of character at that place is printed. | |
;;; First load... | |
;;; sbcl | |
;;; * (load "magic.lisp") | |
;;; (magic) |
This file contains 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
snippet bps | |
bps (${1:240}/120) | |
endsnippet | |
snippet d | |
d${1:1} $ $0 | |
endsnippet | |
snippet sound | |
sound "$1" |
This file contains 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 | |
/** | |
* The name of the taxonomy central database, usually from $databases | |
* configuration in settings.php | |
*/ | |
define('TAXONOMY_CENTRAL_DATABASE_NAME', 'vocabulary_server'); | |
/** | |
* Controller class for taxonomy central vocabularies. |
This file contains 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
$thing_path = libraries_get_path('thing'); | |
require_once($thing_path . '/thing.php'); | |
$thing = new thing(); | |
exit(); |
This file contains 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
:help | |
vimtutor | |
http://vimcasts.org/ - simply brilliant Vim screencasts. | |
http://pragprog.com/book/dnvim/practical-vim - buy it! | |
http://vimeo.com/vimlondon - videos from Vim London sessions. | |
http://vim-adventures.com/ - learn Vim while playing a game, unlock levels, pay for. | |
http://vimgolf.com/ - Pick a challenge, fire up Vim, and show us what you got. | |
https://github.com/carlhuda/janus/ - the Janus Vim distribution provides a minimal working environment using the most popular plug-ins and the most common mappings. | |
https://drupal.org/project/vimrc - customizes the vim text editor for editing Drupal-related files. | |
https://drupal.org/node/29325 - Configuring Vim |
This file contains 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
czettnersandor | |
janetrimmer | |
Eli-TW |
This file contains 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
noremap <Up> <NOP> | |
inoremap <Up> <NOP> | |
vnoremap <Up> <NOP> | |
noremap <Down> <NOP> | |
inoremap <Down> <NOP> | |
vnoremap <Down> <NOP> | |
noremap <Left> <NOP> | |
inoremap <Left> <NOP> | |
vnoremap <Left> <NOP> | |
noremap <Right> <NOP> |
NewerOlder