Skip to content

Instantly share code, notes, and snippets.

View binarymason's full-sized avatar
👾
meep

John Mason binarymason

👾
meep
View GitHub Profile
@binarymason
binarymason / .gitignore
Created March 13, 2019 10:20 — forked from karmi/.gitignore
Example Nginx configurations for Elasticsearch (https://www.elastic.co/blog/playing-http-tricks-nginx)
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/
@binarymason
binarymason / example.rb
Created May 24, 2017 18:59 — forked from woods/example.rb
How to dynamically query enum values from Postgresql in Rails
sql = %{
select enumlabel
from pg_enum
where enumtypid = 'company_status'::regtype
order by oid
}
result = ActiveRecord::Base.connection.execute(sql)
result.each do |row|
@binarymason
binarymason / _flash_messages.html.erb
Last active March 12, 2016 19:15 — forked from roberto/_flash_messages.html.erb
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@binarymason
binarymason / GitIgnore Fix
Created December 14, 2015 15:59 — forked from cillosis/GitIgnore Fix
When .gitignore is not working...
git rm -r --cached .
git add .