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 -e | |
| echo `ruby -v | sed 's/(.*//g' | sed 's/ruby//g' |sed 's/ //g' |sed 's/[ \t]*$//'` | |
| # I realized after spending about 30 minutes on building up this command for my zsh Prompt that | |
| # rvm_ruby_string contains the same thing. | |
| # However, the reason I added this to my prompt is RVM kept giving me problems with not switching from OSX inbuilt ruby to the | |
| # current environment...so adding an indicator always helps. |
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
| #!/usr/bin/env ruby | |
| #Usage: | |
| # Echo.bold OutputString | |
| # | |
| # \e[z;XX;YYm | |
| class TermFormat | |
| @DEFAULTS ={ |
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
| #!/usr/bin/env ruby | |
| class GetPid | |
| #Main | |
| ARGV.each do |arg| | |
| puts `Echo.rb bold red "Query: #{arg}"` | |
| pids=`ps aux | grep -v grep | grep #{arg} | awk '{print $2}'`.split("\n") | |
| pids.each do |pid| | |
| puts `Echo.rb bold blue "\tPID: #{pid}"` | |
| 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
| [user] | |
| email = [email protected] | |
| name = Michael Clark | |
| [credential] | |
| helper = osxkeychain | |
| [alias] | |
| lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
| rmb = !sh -c 'git branch -D $1 && git push origin :$1' - | |
| cob = checkout -b | |
| up = !git fetch origin && git rebase origin/master |
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
| import sublime, sublime_plugin | |
| class DefaultSyntaxCommand(sublime_plugin.EventListener): | |
| def on_new(self, view): | |
| view.set_syntax_file('Packages/Ruby/Ruby.tmLanguage') |
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
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://npmjs.org/install.sh | sh |
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
| <?php | |
| /** | |
| * Tries to force the minicalendar widget to show the month of the next upcoming event by default, rather | |
| * than simply showing the current month (which might be empty). | |
| */ | |
| class Tribe_Advance_Minical | |
| { | |
| protected $target_date = false; | |
| /** |
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
| <html> | |
| <style type="text/css"> | |
| .container{width:400px;} | |
| .container .element {width:33%; float:left;} | |
| .blue {background:blue;} | |
| .orange {background:orange;} | |
| .gray {background: gray;} | |
| </style> | |
| <div class="container"> | |
| <div class="element blue"> </div> |
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
| options = ['St Louis', 'KC', 'Omaha', 'Minneappolis','Branson', 'Nashville', 'Indy']; | |
| votes = [0,0,0,0,0,0,0] | |
| for(count = 0; count < 10; count++){ | |
| let idx = Math.floor(Math.random() * options.length) | |
| votes[idx]++ | |
| } | |
| document.open(); | |
| document.close(); | |
| document.write('Winner: ' + options[votes.indexOf(Math.max(...votes))]) |
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
| function killPort(){ | |
| lsof -i tcp:$1 | awk '{print $2}' | grep -v 'PID' | xargs kill | |
| } |
OlderNewer