Skip to content

Instantly share code, notes, and snippets.

View zackheil's full-sized avatar

Zack Heil zackheil

  • /^(ar)?kansas$/i
  • 11:44 (UTC -05:00)
View GitHub Profile

ZSH CheatSheet

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.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@slavikshen
slavikshen / ReactJS-InnerText.js
Created November 10, 2015 15:37
How to get inner text in React virtual DOM
$(function() {
React.getInnerText = function(obj) {
var buf = '';
if( obj ) {
var type = typeof(obj);
if( type === 'string' || type === 'number' ) {
buf += obj;
} else if( type === 'object' ) {
var children = null;
if( Array.isArray(obj) ) {
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 29, 2025 08:29
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx