Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# <bitbar.title>Battery Indicator</bitbar.title>
# <bitbar.version>v0.2</bitbar.version>
# <bitbar.author>Josh Teeter</bitbar.author>
# <bitbar.author.github>whatisinternet</bitbar.author.github>
# <bitbar.desc>Get your battery life indicator in the menu bar</bitbar.desc>
if $(pmset -g batt | grep -qoEi "discharging"); then
echo $(pmset -g batt | grep -oEi "(\d{0,}:\d{0,} remaining)")
else
echo ":zap:"
@whatisinternet
whatisinternet / multiple_ssh_setting.md
Created September 9, 2016 13:58 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"

NPM error 139: Check your sass/scss files for strange syntax like:

  .foo
    &-bar
      @include &

or

Developer Cheat Sheets

This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.

I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.

@whatisinternet
whatisinternet / pizza.rb
Created March 14, 2015 16:53
pizza-pizza
require 'capybara'
require 'capybara/dsl'
require 'selenium-webdriver'
Capybara.default_driver = :webkit
Capybara.run_server = false
module Pizza
class PizzaPizza
attr_accessor :pizza_types, :pizzas, :city, :delivery, :phoenix, :pizza_count
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[green]%}➜ %s)"
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
# OS
alias sagu='sudo apt-get update && sudo apt-get upgrade'
alias saguy='sudo apt-get update && sudo apt-get -y -V upgrade'
alias sagup='sudo apt-get update'
alias sagi='sudo apt-get install '
alias sagr='sudo apt-get remove'
alias sedit='sudo subl '
alias sfolder='gksudo nautilus'
alias documents='cd ~/Documents'
alias ..='cd ..'
@whatisinternet
whatisinternet / chkltyUpdater.ps1
Created January 28, 2014 20:37
My Chocolatey script
#----------------------------
# Filename: chkltyUpdater.ps1
# Author: Josh Teeter
# Date: 2014-01-27
# Version: 1.0.0.0
# Purpose: takes a list of chocolatey apps and updates them. :)
#----------------------------
#
# Get the current execution path
#
@whatisinternet
whatisinternet / chklty Updater.bat
Created January 17, 2014 17:56
http://chocolatey.org/ install and update scripts (batch)
@echo off
cls
echo browsers
powershell cup Firefox
powershell cup GoogleChrome
cls
echo plugins
powershell cup Silverlight
@whatisinternet
whatisinternet / bingHide.cmd
Created November 28, 2013 19:00
This will hide the irritating bing desktop application in windows update. (May require the batch file to be run as administrator)
::-------------------------
:: Name: bingHide.cmd
:: Author: Josh Teeter
:: Date: 2013-06-26
:: Version: 1.0.0.0
:: Purpose: This will hide bing desktop
::-------------------------
powershell Set-ExecutionPolicy bypass
powershell -File "%~dp0\bingHide.ps1"
powershell Set-ExecutionPolicy Restricted