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
# Track currently active .nvmrc file. | |
ZSH_NVMRC_ACTIVE="" | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
# Ignore missing nvm (e.g. wrong load order). | |
if ! command -v nvm &> /dev/null; then | |
return | |
fi |
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
from argparse import ArgumentParser | |
__all__ = ['execute', 'metacommand', 'command', 'argument'] | |
_reserved_args = 'func', 'command' | |
_default_registry = {} | |
def execute(args, prog=None, commands=None): |
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
get :: retrieveCache || retrieveUpdate => data | |
update :: retrieveUpdate => data | |
subscribe(s :: data => {}) :: <addSubscriber>(s) + (retrieveCache => data) && s(data) + refresh | |
unsubscribe(s) :: <removeSubscriber>(s) | |
refresh :: !retrieveCache && retrieveUpdate ~~~> <subscribed> && refresh | |
retrieveCache :: !<expired> && fetchCache => data | |
retrieveUpdate :: <debounce>(fetchRemote || fetchCache || fetchInitial) => data | |
fetchCache :: loadCache => data || <error> |
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
#!/bin/sh | |
DEFAULT_GITIGNORE='.idea\nnode_modules' | |
DEFAULT_ESLINTIGNORE='node_modules' | |
DEFAULT_ESLINTRC='{"parser":"babel-eslint","extends":"airbnb","plugins":["prefer-object-spread"],"rules":{"prefer-object-spread/prefer-object-spread":2}}' | |
DEFAULT_BABELRC='{"presets":["env"]}' | |
git init | |
npm init -y | |
npm i -D babel-eslint eslint-plugin-prefer-object-spread jest babel-jest |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: mysqltmpfs | |
# Required-Start: $local_fs $remote_fs $syslog | |
# Required-Stop: $local_fs $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# X-Start-Before: mysql | |
# X-Stop-After: mysql | |
### END INIT 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
module_load_include('inc', 'field', 'field.crud'); | |
$fields = field_read_fields(array('type' => 'taxonomy_term_reference')); | |
foreach ($fields as $field) { | |
if (isset($field['settings']['options_list_callback']) && $field['settings']['options_list_callback'] == 'content_taxonomy_allowed_values') { | |
$field['settings']['options_list_callback'] = 'taxonomy_allowed_values'; | |
field_update_field($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
Use this script to archive a specific release of the project. This script exports a git project with a specific object (e.g. tag), adds version information to the module <code>*.info</code> files and packages the project into properly named archive. | |
To start using the script, download the script and place it in the parent directory of your git project folders. For security reasons, the uploaded script below is named as a text file. If desired, the script can be renamed. | |
<h3>Usage</h3> | |
<kbd>export-project [-D <output_dir>] [-C <working_dir>] [-z|-g] [-x <ext>] | |
[-N] [-P] [-A|-F <url>] <project> <tree-ish> [<version>]</kbd> | |
<h4>Arguments</h4> |
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
$nodes = array(); | |
foreach (content_fields() as $field_key => $field) { | |
if (strpos($field['module'], 'content_taxonomy') === 0) { | |
$type = $field['type_name']; | |
$nodes[$field['vid']][$field_key] = $type; | |
} | |
} | |
module_load_include('inc', 'taxonomy', 'taxonomy.admin'); | |
foreach ($nodes as $vid => $types) { | |
$vocabulary = (array) taxonomy_vocabulary_load($vid); |