Code Monkey home page Code Monkey logo

iterm-and-so-can-you's Introduction

%title: iTerm and So Can You %author: Ustice (Jason Kleinberg) %date: 2016-09-16

-> Who am I? <-

^

-> Jason Kleinberg. -> Web developer here at Mobquity.


-> I use my terminal every day...


-> To run my code...

^

$ node app

Hello World


-> To install packages...

^

$ npm install lodash

/repos/iterm-and-so-can-you └── [email protected]


-> To get system information...

^

$ ipconfig getifaddr en0

10.227.2.92


-> And more.


-> Terminal shells have been around as long as Unix (early 1970s), ^ -> and they're largely unchanged, ^ -> but that doesn't mean that they are static.


-> This is my prompt. -> (There are many like it, but this one is mine...)


-> Not what you expected, eh? 😎

-> I have customized my prompt with Oh My Zsh and PowerLevel9k.


-> Your terminal is feature-packed, and fully customizable.

^

-> It's a collection of little tools and utilities that you can mix and match to -> make your life as a developer easier.

-> And I want to share with you a few little gems that I have found/created.


-> Aliases are the easiest way to start. Is there a command that you type a lot? ^ -> Wish it took fewer keystrokes? ^ -> Alias it! ^

$ alias gs="git status --short"
$ gs

M README.md D logo.txt M start


-> Need something a little more complex? ^ -> Functions and scripts have you covered. ^

gpf (git push feature)

#!/bin/zsh

BRANCH=$(git symbolic-ref HEAD --short)

git push -u origin HEAD:${BRANCH}
hub browse

-> This pushes the current branch to origin, updates the tracking branch, and -> opens the GitHub page in the browser. ^

function standup(){
  if [ -z "$1" ]; then
    mdless $NOTES -P
  elif [ "$1" == "list" ]; then
    mdless $NOTES -lP --no-color | grep "^ \S" --color=never
  else
    mdless $NOTES -s $1 -P
  fi
}

More on this in a bit...


-> imgcat

-> Show images inline in the terminal (inlcuded with iTerm2)

^

-> With it, I created a little utility to retrieve a weather radar, and give me weather information, right in my terminal. ^

alias weather="curl -sS http://radar.weather.gov/Conus/Loop/southeast_loop.gif | imgcat && ansiweather"

-> jq

-> jq is a JSON processor

^

-> With it, I created a little utility to get the dependencies of a project. ^

#!/bin/zsh

PROJECT_ROOT=$(git rev-parse --show-toplevel)
cat "${PROJECT_ROOT}/package.json" | jq .dependencies

-> mdless

-> mdless is a Markdown viewer for the terminal.

^

-> With it, I have created a To Do list that works across projects. ^

function standup(){
  if [ -z "$1" ]; then
    mdless $NOTES -P
  elif [ "$1" == "list" ]; then
    mdless $NOTES -lP --no-color | grep "^ \S" --color=never
  else
    mdless $NOTES -s $1 -P
  fi
}

-> I'm not an expert at this stuff. ^

-> And this is just a tiny glimpse into the power of your terminal. ^

-> There are people here that are way more advanced than me, -> but I hope that this has at least inspired you to take a second look at what -> you can do in your shell.


-> Want to see how I did all of this?

-> Got an idea on how to make it better? Send me a pull request!

-> https://github.com/Ustice/iterm-and-so-can-you

-> https://github.com/Ustice/dotfiles

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.