This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| scope :located_near, lambda { |distance, long, lat| | |
| geoFactory = RGeo::Geographic.spherical_factory | |
| circle = geoFactory.point(long, lat).buffer(distance.to_f * 1609.34) # METERS PER MILE | |
| where("Intersects(location, GeomFromText(\"#{circle}\"))") | |
| } |
This gist is a collection of my rough notes from Strange Loop 2012.
| <%= simple_form_for @product do |f| %> | |
| <%= f.simple_fields_for :attributes do |d| %> | |
| <% f.object.attributes.try(:each) do |key, value| %> | |
| <%= d.input key, :input_html => {:value => value } %> | |
| <% end %> | |
| <% end %> | |
| <% end %> |
| #!/bin/bash | |
| # | |
| # PostgreSQL Backup Script Ver 1.0 | |
| # http://autopgsqlbackup.frozenpc.net | |
| # Copyright (c) 2005 Aaron Axelsen <[email protected]> | |
| # | |
| # This script is based of the AutoMySQLBackup Script Ver 2.2 | |
| # It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
| # | |
| # The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
| # -------------------------------------------- | |
| # This code is for Twitter Bootstrap 2! | |
| # -------------------------------------------- | |
| # | |
| # The MIT License (MIT) | |
| # Copyright (c) 2012-2015 Dennis Riehle | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights |
| Copyright (c) 2011 ZURB, http://www.zurb.com/ |
~/local/filegdb. Here's an example path to one of the files: ~/local/filegdb/lib/libFileGDBAPI.dylib~/local/filegdb so it can stay isolated in it's own place. You can put it anywhere, but the next few steps might be different.~/local/filegdb@rpath's, so to avoid needing to mess with DYLD_LIBRARY_PATH, I updated the @rpath's using install_name_tool. There might be a more elegant way to handle this. If so, comments are welcome!DYLD_LIBRARY_PATH yourself:| = simple_form_for [:admin, @holiday_schedule] do |f| | |
| = render 'error_messages', target: @holiday_schedule, f: f if @holiday_schedule.errors.any? | |
| = f.input :name | |
| .control-group | |
| = f.label :holidays | |
| = f.simple_fields_for :holidays do |holiday| | |
| = render 'holiday_fields', f: holiday | |
| .nested-fields-link | |
| = link_to_add_association t('actions.add', | |
| :model => Holiday.model_name.human.titleize), f, :holidays |
| create or replace function hs_2json(hs hstore) returns text language sql | |
| as $f$ | |
| select '{' || array_to_string(array_agg( | |
| '"' || regexp_replace(key,E'[\\"]',E'\\\&','g') || '":' || | |
| case | |
| when value is null then 'null' | |
| when value ~ '^(true|false|(-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?))$' then value | |
| else '"' || regexp_replace(value,E'[\\"]',E'\\\&','g') || '"' | |
| end |