Skip to content

Instantly share code, notes, and snippets.

View garrypolley's full-sized avatar
🧸
Code and Stuff

Garry Polley garrypolley

🧸
Code and Stuff
View GitHub Profile
@garrypolley
garrypolley / ruby.rb
Created February 18, 2015 22:18
Want to see if the first character is an integer in your Ruby Object?
def integer_first?(x)
!!/^\d/.match(x)
end
@garrypolley
garrypolley / Garry.css
Created January 21, 2015 22:28
Theme for LimeChat. Removes unnecessary comments from view. See: https://github.com/psychs/limechat/issues/240
html {
font-family: "Dejavu Sans Mono", "Monaco", monospace;
font-size: 9pt;
background-color: #202020;
color: #FFFFFF;
padding: 0;
margin: 0;
}
body {
@garrypolley
garrypolley / stuff_done.md
Created October 4, 2014 21:19
install steps for openalpr. trying ot help out at hackmizzou

Install system dependencies:

  • Note I have a lot of c libraries already installed from Python development
  • cmake
  • leptonica

Dir setup:

@garrypolley
garrypolley / like_python.rb
Created July 16, 2014 12:19
Making the world a little crazier with Ruby. This could obviously be more robust.
class DynamicSingletonMethods
def method_missing(meth,*args,&block)
method_string = meth.to_s
if method_string.end_with? '='
method = method_string.split('=')[0]
self.define_singleton_method(method.to_sym) do args[0] end
else
super
end
@garrypolley
garrypolley / garry.zsh-theme
Created July 1, 2014 21:57
my zsh theme right now for rails development
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='${ret_status}%{$fg_bold[green]%}%p$(rvm_gemset)%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
# Determine if we are using a gemset.
function rvm_gemset() {
@garrypolley
garrypolley / garry.theme
Last active August 29, 2015 14:02
My ZSH theme combination of robbyrussell.theme and Soliah.theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='${ret_status}%{$fg_bold[green]%}%p$(rvm_gemset)%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
# Determine if we are using a gemset.
function rvm_gemset() {
@garrypolley
garrypolley / code1.md
Created March 6, 2014 01:07
simple examples for djorm presentation
User.objects.all()
User.objects.filter(age__gt=32)
User.objects.profiles().filter(is_member=True)
@garrypolley
garrypolley / blogs.md
Last active August 29, 2015 13:57
Blog gists
@garrypolley
garrypolley / interesting.md
Created February 23, 2014 16:35
Learning Python 5th addition notes

I've been programming Python for a few years. Should have known some of this stuff already, but there's always room to learn more.

raw string vs normal string. Just use the r'' to not have to escape when I don't want to escape. 😄

In [5]: r'\n'
Out[5]: '\\n'

In [6]: '\n'
Out[6]: '\n'
@garrypolley
garrypolley / pythonfixes.sh
Created December 30, 2013 17:24
Fix python install after osx upgrade
# ASSUMES you want Python 2.7.5 as your system default
cd /usr/bin
sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/python python2.7
sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/python-config python2.7-config
sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/pythonw pythonw2.7
sudo ln -sf python2.7 python
sudo ln -sf pythonw2.7 pythonw
sudo ln -sf python2.7-config python-config