- Jump down to the plugin
- Try it on Codepen — and heart it!
- Try it on Tailwind Play
- Read my blog post about this plugin - and share it!
and star this gist!
and star this gist!
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
Description | Syntax |
---|---|
Get the length of a string | ${#VARNAME} |
Get a single character | ${VARNAME[index]} |
Instructions for installing zsh plugins, for a variety of plugin managers
Add <owner>/<repo>
to your plugins file. If you use static loading, run the update command.
Antidote: Add <owner>/<repo>
to your plugins file. If you generate your static plugins file manually, run the bundle command.
<?php | |
namespace Craft; | |
class FractalPlugin extends BasePlugin | |
{ | |
public function init() | |
{ | |
craft()->templates->getTwig()->setLoader(new FractalTemplateLoader()); |
I'm currently the lead instructor at Code Platoon and an instructor/developer at the Turing School of Software and Design.
I've been advocating the Fish shell and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled Bash shell, that I figured it's worth laying out my reasoning.
# On slow systems, checking the cached .zcompdump file to see if it must be | |
# regenerated adds a noticable delay to zsh startup. This little hack restricts | |
# it to once a day. It should be pasted into your own completion file. | |
# | |
# The globbing is a little complicated here: | |
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct. | |
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error) | |
# - '.' matches "regular files" | |
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours. | |
autoload -Uz compinit |
#!/bin/bash | |
# | |
# Notify of Homebrew updates via Notification Center on Mac OS X | |
# | |
# Author: Chris Streeter http://www.chrisstreeter.com | |
# Requires: terminal-notifier. Install with: | |
# brew install terminal-notifier | |
TERM_APP='/Applications/Terminal.app' | |
BREW_EXEC='/usr/local/bin/brew' |
<!-- | |
* GOOGLE MAP W/ MULTIPLE MARKERS AND OPTIONAL GEOCODING | |
* by Boots (www.boots.media) | |
* Working demo here: https://codepen.io/bootsified/details/XWbgwNr | |
* | |
* To use geocoding for locations, set `useGeocoding = true;` (limit 10 locations). | |
* To manually place markers by lat/lng, set `useGeocoding = false;` (no limit). Locations array must contain lat/lng data. | |
--> | |
<script src="https://maps.googleapis.com/maps/api/js?key=[YOUR_APP_KEY_GOES_HERE]"></script> |
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
$ cd /tmp/ | |
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
$ plutil -convert xml1 com.googlecode.iterm2.plist | |
$ vi com.googlecode.iterm2.plist |