GeoEntity.last
SELECT geo_entities.* FROM geo_entities ORDER BY geo_entities.id DESC LIMIT 1
returns:
County id: 4, eid: nil, pid: nil, ename: nil, etype: 2, created_at: "2011-11-21 06:26:37", updated_at: "2011-11-21 06:26:37"
GeoEntity.last
SELECT geo_entities.* FROM geo_entities ORDER BY geo_entities.id DESC LIMIT 1
returns:
County id: 4, eid: nil, pid: nil, ename: nil, etype: 2, created_at: "2011-11-21 06:26:37", updated_at: "2011-11-21 06:26:37"
| <? | |
| /** | |
| * Repeatable Custom Fields in a Metabox | |
| * Author: Helen Hou-Sandi | |
| * | |
| * From a bespoke system, so currently not modular - will fix soon | |
| * Note that this particular metadata is saved as one multidimensional array (serialized) | |
| */ | |
| function hhs_get_sample_options() { |
| <?php | |
| add_action('admin_init', 'add_meta_boxes', 1); | |
| function add_meta_boxes() { | |
| add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high'); | |
| } | |
| function repeatable_meta_box_display() { | |
| global $post; |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| // CSS Color Names | |
| // Compiled by @bobspace. | |
| // | |
| // A javascript object containing all of the color names listed in the CSS Spec. | |
| // This used to be a big array, but the hex values are useful too, so now it's an object. | |
| // If you need the names as an array use Object.keys, but you already knew that! | |
| // | |
| // The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp | |
| // Use it as you please, 'cuz you can't, like, own a color, man. |
| This playbook has been removed as it is now very outdated. |
| class Article < ActiveRecord::Base # Product class is similar | |
| belongs_to :user | |
| has_many :media, as: :ownable | |
| with_options through: :media, source: :representable do |assn| | |
| assn.has_many :videos, source_type: 'Video' | |
| assn.has_many :images, source_type: 'Image' | |
| end | |
| end |
| /* | |
| Element to slide gets the following CSS: | |
| max-height: 0; | |
| opacity: 0; | |
| overflow: hidden; | |
| transition: max-height 0.4s ease 0s; | |
| */ | |
| /** | |
| * Like jQuery's slideDown function - uses CSS3 transitions |
| gem 'foreman' | |
| gem 'puma' |