gem "rails_admin"
gem 'bootsy'
# 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 |
// [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({ |
# 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 |
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, |
require 'net/http' | |
include HTTParty | |
# test app | |
YAHOO_CONFIG = { | |
client_id: "YOUR APP ID", | |
client_secret: "YOUR APP SECRET" | |
} |
########################################## | |
# 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 |
body.active_admin { | |
.cke_chrome { | |
width: 76% !important; | |
overflow: hidden; | |
} | |
.cke_dialog_background_cover{ | |
background-color: black !important; | |
} | |
} | |
body.active_admin { |