This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SQL_PHONE_NORMALIZER Example: | |
# Lead.find_by_sql(PhoneFinder::SQL_PHONE_NORMALIZER.call(table: 'leads', column_name: 'phone', phone: '(555) 760-2012')) | |
# User.find_by_sql(PhoneFinder::SQL_PHONE_NORMALIZER.call(table: 'users', column_name: 'phone', phone: '555-223-4027')) | |
# | |
# AREL_PHONE_NORMALIZER Example: | |
# PhoneFinder::AREL_PHONE_NORMALIZER.call(rel: Lead.where(email: '[email protected]'), table: 'leads', column_name: 'phone', phone: '(555) 760-2012') | |
# PhoneFinder::AREL_PHONE_NORMALIZER.call(rel: User.where(email: '[email protected]'), table: 'users', column_name: 'phone', phone: '555-223-4027') | |
# | |
# See: https://coderbits.com/posts/pCl7og | |
module PhoneFinder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Patterned after this LogFormatter: | |
# https://github.com/QutBioacousticsResearchGroup/bioacoustic-workbench/blob/master/config/initializers/log_formatting.rb | |
# And some of this: | |
# http://95.154.230.254/ip-1/encoded/Oi8vcGFzdGViaW4uY29tL1hxRU1keGRT | |
# Makes as much as possible constant values to not bog down GC and make it whip fast | |
class ColorLogger | |
SEVERITY_TO_TAG_MAP = {'DEBUG' => 'meh', 'INFO' => 'fyi', 'WARN' => 'hmm', 'ERROR' => 'wtf', 'FATAL' => 'omg', 'UNKNOWN' => '???'} | |
SEVERITY_TO_COLOR_MAP = {'DEBUG' => '0;37', 'INFO' => '32', 'WARN' => '33', 'ERROR' => '31', 'FATAL' => '31', 'UNKNOWN' => '37'} | |
USE_HUMOROUS_SEVERITIES = begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DESCRIPTION: | |
# For auto lazy loading of namespaced objects nested in sub-directories | |
# This is a custom library loader - Written by Peter Boling | |
# INSTALLATION: | |
# 1. Add 'gist-dep' to your Gemfile | |
# 2. bundle install | |
# 3. gist-dep add --path lib/handy_gists/nested_lib_loader.rb 6265104/nested_lib_loader.rb | |
# 4. add the following lines (uncommented) to your config/application.rb inside the `class Application < Rails::Application` | |
# require "#{config.root}/lib/handy_gists/nested_lib_loader" | |
# include HandyGists::NestedLibLoader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mixin to (i.e. include in) any worker class that does FB API calls and should be throttled. | |
module FacebookThrottle | |
def perform_throttled(*args, &block) | |
options = args.extract_options! | |
user = User.find_by_fb_uid(options[:fb_uid]) | |
if user | |
if !user.valid_facebook_token? # A bitwise flag managed by flag_shih_tzu gem | |
puts "Skipping #{self.class} #{user.fb_uid}: Invalid Oauth Token for #{user}" | |
return false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2013-03-15 05:30:16,530 INFO [neo4j.txmanager]: TM new log: tm_tx_log.1 | |
2013-03-15 05:30:16,556 INFO [neo4j.xafactory]: Opened logical log [/var/lib/neo4j/data/graph.db/index/lucene.log.1] version=0, lastTxId=1 (clean) | |
2013-03-15 05:30:16,560 DEBUG [neo4j.diagnostics]: --- STARTUP diagnostics START --- | |
2013-03-15 05:30:16,561 DEBUG [neo4j.diagnostics]: Neo4j Kernel properties: | |
2013-03-15 05:30:16,563 DEBUG [neo4j.diagnostics]: forced_kernel_id= | |
2013-03-15 05:30:16,563 DEBUG [neo4j.diagnostics]: read_only=false | |
2013-03-15 05:30:16,563 DEBUG [neo4j.diagnostics]: neo4j.ext.udc.host=udc.neo4j.org | |
2013-03-15 05:30:16,564 DEBUG [neo4j.diagnostics]: logical_log=nioneo_logical.log | |
2013-03-15 05:30:16,564 DEBUG [neo4j.diagnostics]: node_auto_indexing=false | |
2013-03-15 05:30:16,564 DEBUG [neo4j.diagnostics]: intercept_committing_transactions=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /var/lib/neo4j/bin/neo4j console | |
Starting Neo4j Server console-mode... | |
05:23:30,210 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] | |
05:23:30,211 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] | |
05:23:30,211 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/usr/share/neo4j/system/lib/neo4j-server-1.8.1.jar!/logback.xml] | |
05:23:30,232 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@52c05d3b - URL [jar:file:/usr/share/neo4j/system/lib/neo4j-server-1.8.1.jar!/logback.xml] is not of type file | |
05:23:30,351 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set | |
05:23:30,357 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] | |
05:23:30,362 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT] | |
0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2013-03-13 21:55:13,456 DEBUG [neo4j.diagnostics]: nioneo_logical.log.v5: 2013-03-13T21:54:23+0000 - 22.61 MB | |
2013-03-13 21:55:13,456 DEBUG [neo4j.diagnostics]: nioneo_logical.log.v2: 2013-03-13T20:26:56+0000 - 25.00 MB | |
2013-03-13 21:55:13,456 DEBUG [neo4j.diagnostics]: neostore.relationshipstore.db: 2013-03-13T21:54:35+0000 - 2.11 MB | |
2013-03-13 21:55:13,456 DEBUG [neo4j.diagnostics]: neostore.propertystore.db.strings.id: 2013-03-13T21:54:35+0000 - 9.00 B | |
2013-03-13 21:55:13,457 DEBUG [neo4j.diagnostics]: nioneo_logical.log.v6: 2013-03-13T21:55:12+0000 - 16.00 B | |
2013-03-13 21:55:13,457 DEBUG [neo4j.diagnostics]: neostore.relationshipstore.db.id: 2013-03-13T21:54:35+0000 - 9.00 B | |
2013-03-13 21:55:13,457 DEBUG [neo4j.diagnostics]: neostore.nodestore.db: 2013-03-13T21:54:35+0000 - 569.00 kB | |
2013-03-13 21:55:13,457 DEBUG [neo4j.diagnostics]: neostore: 2013-03-13T21:55:12+0000 - 54.00 B | |
2013-03-13 21:55:13,458 DEBUG [neo4j.diagnostics]: nioneo_logical.log.v1: 2013-03-13T20:13:29+0000 - 25.00 MB | |
2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2013-03-13T22:55:32+00:00 app[low.1]: 2013-03-13T22:55:32Z 2 TID-wdnkc WARN: 757: unexpected token at '<html> | |
2013-03-13T22:55:32+00:00 app[low.1]: <head> | |
2013-03-13T22:55:32+00:00 app[low.1]: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> | |
2013-03-13T22:55:32+00:00 app[low.1]: <title>Error 500 Failed to get current transaction.</title> | |
2013-03-13T22:55:32+00:00 app[low.1]: </head> | |
2013-03-13T22:55:32+00:00 app[low.1]: <body><h2>HTTP ERROR 500</h2> | |
2013-03-13T22:55:32+00:00 app[low.1]: <p>Problem accessing /db/data/ext/GremlinPlugin/graphdb/execute_script. Reason: | |
2013-03-13T22:55:32+00:00 app[low.1]: <pre> Failed to get current transaction.</pre></p><h3>Caused by:</h3><pre>org.neo4j.graphdb.TransactionFailureException: Failed to get current transaction. | |
2013-03-13T22:55:32+00:00 app[low.1]: at org.neo4j.kernel.impl.core.LockReleaser.getTransaction(LockReleaser.java:341) | |
2013-03-13T22:55:32+00:00 app[low.1]: at org.neo4j.kernel.impl.core.LockReleaser.getCowPropertyRemoveMap(Loc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /var/lib/neo4j/bin/neo4j start | |
Starting Neo4j Server...21:58:39,775 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] | |
21:58:39,775 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] | |
21:58:39,775 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/usr/share/neo4j/system/lib/neo4j-server-1.8.1.jar!/logback.xml] | |
21:58:39,803 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2dec8909 - URL [jar:file:/usr/share/neo4j/system/lib/neo4j-server-1.8.1.jar!/logback.xml] is not of type file | |
21:58:39,922 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set | |
21:58:39,929 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] | |
21:58:39,933 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT] | |
21:58:39,950 |-IN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /var/lib/neo4j/bin/neo4j console | |
Starting Neo4j Server console-mode... | |
21:54:34,229 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] | |
21:54:34,229 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] | |
21:54:34,229 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/usr/share/neo4j/system/lib/neo4j-server-1.8.1.jar!/logback.xml] | |
21:54:34,252 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@52c05d3b - URL [jar:file:/usr/share/neo4j/system/lib/neo4j-server-1.8.1.jar!/logback.xml] is not of type file | |
21:54:34,445 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set | |
21:54:34,470 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] | |
21:54:34,474 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT] | |
2 |