By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
| desc "switch rails logger to stdout" | |
| task :verbose => [:environment] do | |
| Rails.logger = Logger.new(STDOUT) | |
| end | |
| desc "switch rails logger log level to debug" | |
| task :debug => [:environment, :verbose] do | |
| Rails.logger.level = Logger::DEBUG | |
| end |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """Script to bootstrap an Odoo database (8.0).""" | |
| import odoorpc | |
| # Odoo connection | |
| SUPER_PWD = 'admin' | |
| HOST = 'localhost' | |
| PORT = 8069 | |
| DB = 'my_db' |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
| /** | |
| * Check if localStorage is supported const isSupported: boolean | |
| * Check if localStorage has an Item function hasItem(key: string): boolean | |
| * Get the amount of space left in localStorage function getRemainingSpace(): number | |
| * Get the maximum amount of space in localStorage function getMaximumSpace(): number | |
| * Get the used space in localStorage function getUsedSpace(): number | |
| * Get the used space of an item in localStorage function getItemUsedSpace(): number | |
| * Backup Assosiative Array interface Backup | |
| * Get a Backup of localStorage function getBackup(): Backup | |
| * Apply a Backup to localStorage function applyBackup(backup: Backup, fClear: boolean = true, fOverwriteExisting: boolean = true) |
| class RedisSessionStore(SessionStore): | |
| def __init__(self, expire = 1800, key_prefix=''): | |
| SessionStore.__init__(self) | |
| self.redis = redis.Redis(tools.config.get('redis_host', 'localhost'), | |
| int(tools.config.get('redis_port', 6379)), | |
| int(tools.config.get('redis_dbindex', 1)), | |
| password=tools.config.get('redis_pass', None)) | |
| self.path = session_path() | |
| self.expire = expire | |
| self.key_prefix = key_prefix |
| # | Metric | Haml | Slim | Winner |
|---|---|---|---|---|
| 1 | Issues | Slim | ||
| 2 | Stars | Slim | ||
| 3 | Quality | -- | Haml | |
| 4 | Test Coverage | ; | |
| const https = require('https'); | |
| const url = require('url'); | |
| // to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
| const slack_url = 'https://hooks.slack.com/services/...'; | |
| const slack_req_opts = url.parse(slack_url); | |
| slack_req_opts.method = 'POST'; | |
| slack_req_opts.headers = {'Content-Type': 'application/json'}; |
Assuming a database mydb, and a canonical database file defined in a file tables.sql, here is a way to tell if an operational schema differs from the canonical one:
pg_dump -U postgres -a mydb > mydbdata.sql
psql -U postgres -c "drop database mydbcanonical"
psql -U postgres -c "create database mydbcanonical"
psql -U postgres -d mydbcanonical -f tables.sql
psql -U postgres -d mydbcanonical -f mydbdata.sql| #!/bin/sh | |
| #%# family=manual | |
| #%# capabilities=autoconf suggest | |
| # Munin plugin for transactions/minute | |
| case $1 in | |
| autoconf) | |
| exit 0 | |
| ;; | |
| suggest) |