gem "rails_admin"
gem 'bootsy'
| body.active_admin { | |
| .cke_chrome { | |
| width: 76% !important; | |
| overflow: hidden; | |
| } | |
| .cke_dialog_background_cover{ | |
| background-color: black !important; | |
| } | |
| } | |
| body.active_admin { |
| ########################################## | |
| # Use cases: | |
| # setting a config variable: Variable[:my_key] = 1 | |
| # getting a config variable: Variable[:my_key] | |
| # retrieving all keys: Variable.keys | |
| # deleting a key: Variable.delete!(:my_key) | |
| # checking existence: Variable.exists?(:my_key) | |
| # clear all keys: Variable.clear! | |
| # | |
| # Values are transformed to yaml before stored |
| require 'net/http' | |
| include HTTParty | |
| # test app | |
| YAHOO_CONFIG = { | |
| client_id: "YOUR APP ID", | |
| client_secret: "YOUR APP SECRET" | |
| } |
| BASE_URL = "http://awis.amazonaws.com/" | |
| access_key_id = AppConfig.get_value('aws_access_key_id') | |
| secret_access_key = AppConfig.get_value('aws_secret_access_key') | |
| now = Time.now.utc.iso8601 | |
| url = "yahoo.com" | |
| query = {'AWSAccessKeyId' =>access_key_id, | |
| 'Action' => "UrlInfo", | |
| 'ResponseGroup' => "Rank", | |
| 'SignatureMethod' => "HmacSHA1", | |
| 'SignatureVersion' => 2, |
| # find all html files in a directory and update indentation | |
| find . -iregex '.*/.*\.html' -exec perl -pi -e 's{^((?: {4})*)}{" " x (2*length($1)/4)}e' {} \; | |
| # update ndentation for one file | |
| perl -pi -e 's{^((?: {4})*)}{" " x (2*length($1)/4)}e' yourfile.js |
| // [START initialize_firebase_in_sw] | |
| // Give the service worker access to Firebase Messaging. | |
| // Note that you can only use Firebase Messaging here, other Firebase libraries | |
| // are not available in the service worker. | |
| importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js'); | |
| importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js'); | |
| // Initialize the Firebase app in the service worker by passing in the | |
| // messagingSenderId. | |
| firebase.initializeApp({ |
| # generate invoice number in a sequential mode | |
| # using redis and redlock gem | |
| # ex: | |
| # Accounting::InvoiceNumberGenerator::Base.new.lock do |next_number| | |
| #. # create your invoice here | |
| # end | |
| class Accounting::InvoiceNumberGenerator::Base | |
| LOCK_TIMEOUT = 10000 | |
| FIRST_NUM_SEQUENCE = 100 |
| # file config/initializers/active_record_log_subscriber.rb | |
| ### | |
| # log result: | |
| # Alert Load (0.8ms) SELECT `alerts`.* FROM `alerts` INNER JOIN `sharings` ON `alerts`.`id` = `sharings`.`alert_id` WHERE `sharings`.`user_id` = 37 AND `alerts`.`id` = 54148 AND (status = 0) LIMIT 1 | |
| # ↳ app/controllers/entries_controller.rb:20:in `set_objects' | |
| # source: http://www.jkfill.com/2015/02/14/log-which-line-caused-a-query/ | |
| ### | |
| module LogQuerySource | |
| def debug(*args, &block) |