$ rails g model User
belongs_to
has_one
| # File: app/models/concerns/boolean_store_accessor.rb | |
| # | |
| # When we submit a form in order to update a model, a booelan/checkbox field is posted | |
| # as '1' or '0', and if we are using ActiveRecord::Store, posted value is stored in | |
| # database as '1' or '0'. By the help of this module, we store '1' and '0' | |
| # values as `true` or `false`. | |
| # | |
| # Example usage: | |
| # | |
| # ``` |
| #!/bin/bash | |
| #Download the latest copy of WordPress into a directory, grab all the files in the new /wordpress folder | |
| #Put all the files in the current directory, remove the now empty /wordpress directory | |
| #Remove the tarball | |
| #download latest wordpress with wget | |
| wget http://wordpress.org/latest.tar.gz | |
| #OR using CURL |
| // This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.github.io | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
| */ |
| // swap the keybindings for paste and paste_and_indent | |
| { "keys": ["super+v"], "command": "paste_and_indent" }, | |
| { "keys": ["super+shift+v"], "command": "paste" } |
| function countCSSRules() { | |
| var results = '', | |
| log = ''; | |
| if (!document.styleSheets) { | |
| return; | |
| } | |
| for (var i = 0; i < document.styleSheets.length; i++) { | |
| countSheet(document.styleSheets[i]); | |
| } | |
| function countSheet(sheet) { |
| <?php | |
| # License: Public Domain | |
| # I recommend replacing 'my_' with your own prefix. | |
| function my_template_path() { | |
| return My_Wrapping::$main_template; | |
| } |