Milliseconds in your DateTimes or Timestamps.
We got 'em, you want 'em.
NOTE: only MySQL 5.6.4 and above supports DATETIME's with more precision than a second. For reference see MySQL 5.6.4 Changelog
Shit needs to be PRECISE
# frozen_string_literal: true | |
# Adds migration and schema.rb support to postgres custom enum types, tested on rails 4.2 | |
# The implementation is quite fragile against ActiveRecord version upgrades since it touches many core AR classes. | |
# The following code should be placed in an initializer | |
# On migrations: | |
# | |
# create_enum(:mood, %w(happy great been_better)) | |
# create_table :person do | |
# t.enum :person_mood, enum_name: :mood | |
# end |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
// MIT Licensed | |
// Author: jwilson8767 | |
/** | |
* Waits for an element satisfying selector to exist, then resolves promise with the element. | |
* Useful for resolving race conditions. | |
* | |
* @param selector | |
* @returns {Promise} | |
*/ |
# Use as | |
Cursor.new(Model.includes(foos: [:bar], :foo_bars).where(id < 1000000)).find_each do |model| | |
# do something | |
end | |
# Inspired by https://github.com/afair/postgresql_cursor | |
class Cursor | |
class NoopObserver | |
def close_failed(e) | |
end |
Milliseconds in your DateTimes or Timestamps.
We got 'em, you want 'em.
NOTE: only MySQL 5.6.4 and above supports DATETIME's with more precision than a second. For reference see MySQL 5.6.4 Changelog
Shit needs to be PRECISE
Install HomeBrew first
brew update
brew tap caskroom/cask
brew install brew-cask
If you get the error "already installed", follow the instructions to unlink it, then install again:
class BooleanValue | |
# https://github.com/rails/rails/blob/master/activemodel/lib/active_model/type/boolean.rb | |
FALSE_VALUES = [ | |
false, 0, | |
"0", :"0", | |
"f", :f, | |
"F", :F, | |
"false", :false, | |
"FALSE", :FALSE, | |
"off", :off, |
#!/bin/sh | |
# | |
# Check for ruby style errors | |
red='\033[0;31m' | |
green='\033[0;32m' | |
yellow='\033[0;33m' | |
NC='\033[0m' | |
if git rev-parse --verify HEAD >/dev/null 2>&1 |