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 | |
input=$(pmset -g batt) | |
battery_level=$(echo $input | pcregrep -o1 -i "(\d+)%" | bc) | |
charging=$(echo $input | grep "AC") | |
color=yellow | |
bolt="" | |
if [ "$battery_level" -gt 75 ]; then | |
color=green |
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
tell application "System Events" | |
set processList to (name of every process) | |
end tell | |
if (processList contains "Spotify") is true then | |
tell application "Spotify" | |
set artistName to artist of current track | |
set trackName to name of current track | |
set symbol to "◻︎" | |
set col to "red" |
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/bash | |
sudo apt-get update -qq | |
sudo apt-get install -y git mercurial bison pkg-config mpd mpc libmpdclient2 libmpdclient-dev | |
# Install GVM | |
clean=no bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) | |
source /home/vagrant/.gvm/scripts/gvm | |
gvm get | |
gvm update && source $HOME/.gvm/scripts/gvm |
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
def number_to_currency(number, options = {}) | |
if options[:currency_code].present? | |
options[:unit] = unit_from_currency_code(options[:currency_code]) | |
end | |
super | |
end | |
private |
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
deploy-branch() { | |
stage=$1 | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) bundle exec cap $stage deploy | |
} |
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
# test.rb | |
config.active_support.deprecation = -> (message, callstack) { | |
File.open("#{Rails.root}/deprecations", "a") do |f| | |
f.write message | |
f.write callstack.join("\n ") | |
f.write "\n" | |
end | |
} |
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 SecureAttributes | |
extend ActiveSupport::Concern | |
included do | |
# Load bcrypt gem only when SecureAttributes is used. | |
# This is to avoid ActiveModel (and by extension the entire framework) | |
# being dependent on a binary library. | |
begin | |
require 'bcrypt' | |
rescue LoadError |
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
==> default: npm ERR! Error: No compatible version found: abbrev@'^1.0.5' | |
==> default: npm ERR! Valid install targets: | |
==> default: npm ERR! ["1.0.3","1.0.4","1.0.5","1.0.6","1.0.7"] |
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
vagrant@development:~$ apt list --installed | |
Listing... Done | |
accountsservice/now 0.6.35-0ubuntu7.1 amd64 [installed,upgradable to: 0.6.35-0ubuntu7.2] | |
acl/trusty,now 2.2.52-1 amd64 [installed,automatic] | |
adduser/trusty,now 3.113+nmu3ubuntu3 all [installed] | |
apparmor/trusty-security,now 2.8.95~2430-0ubuntu5.1 amd64 [installed,upgradable to: 2.8.95~2430-0ubuntu5.3] | |
apt/now 1.0.1ubuntu2.6 amd64 [installed,upgradable to: 1.0.1ubuntu2.10] | |
apt-transport-https/now 1.0.1ubuntu2.6 amd64 [installed,upgradable to: 1.0.1ubuntu2.10] | |
apt-utils/now 1.0.1ubuntu2.6 amd64 [installed,upgradable to: 1.0.1ubuntu2.10] | |
apt-xapian-index/trusty,now 0.45ubuntu4 all [installed,automatic] |
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
RUBY_RELEASE_DATE = 2015-12-11 | |
SHELL = /bin/sh | |
NULLCMD = : | |
n=$(NULLCMD) | |
ECHO1 = $(V:1=$n) | |
RUNCMD = $(SHELL) | |
CDPATH = . | |
CHDIR = cd -P | |
exec = exec | |
NULL = /dev/null |