This file contains 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
;;; Use experimental fork of DataScript from https://github.com/allgress/datascript to handle undo and per-query subscriptions | |
(ns reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] |
This file contains 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
1. Get lein | |
lein - http://leiningen.org/ | |
2. `lein new reagent <awesome-project>` | |
3. Some changes to project.clj from last night's talk: | |
:dependencies [[org.clojure/clojure "1.7.0-alpha4"] | |
[org.clojure/clojurescript "0.0-2371"] | |
[org.clojure/core.async "0.1.346.0-17112a-alpha"] | |
[reagent "0.4.3"] |
This file contains 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
require 'method_struct' | |
class CheckForN1Queries < MethodStruct.new(:generator, :operation, :debug) | |
IGNORED_SQL = [ | |
/^SHOW/, /^EXPLAIN/, /^PRAGMA (?!(table_info))/, /^SELECT currval/, /^SELECT CAST/, | |
/^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, | |
/^RELEASE SAVEPOINT/, /^SHOW max_identifier_length/ | |
] | |
def call |
This file contains 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
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.order = "random" | |
config.fail_fast = true | |
config.filter_run :focus | |
config.filter_run_including :focused => true | |
config.run_all_when_everything_filtered = true | |
config.alias_example_to :fit, :focused => true |
This file contains 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
class Integer | |
N_BYTES = [42].pack('i').size | |
N_BITS = N_BYTES * 16 | |
MAX = 2 ** (N_BITS - 2) - 1 | |
MIN = -MAX - 1 | |
end | |
p Integer::MAX #=> 4611686018427387903 | |
p Integer::MAX.class #=> Fixnum | |
p (Integer::MAX + 1).class #=> Bignum |
This file contains 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
0123 0123 0123 0123 0123 0123 0123 0123 0123 0123 | |
1 1 _ 1 _ 1 1 _ 1 _ 1 _ 1 _ 1 _ 1 _ | |
2 | 2 _| 2 _| 2|_| 2|_ 2|_ 2 | 2|_| 2|_| 2| | | |
3 | 3|_ 3 _| 3 | 3 _| 3|_| 3 | 3|_| 3 _| 3|_| | |
000101100 | |
+4 +7 -5 +6 | |
0 - 2 4 6789 |
This file contains 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
module Equalable | |
def ==(o) | |
o.class == self.class && o.equality_state == equality_state | |
end | |
alias_method :eql?, :== | |
def hash | |
equality_state.hash | |
end | |
end |
This file contains 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
group :production, :acceptance do | |
gem 'rpm_contrib' | |
gem 'newrelic-moped' # https://github.com/joinwire/newrelic-moped | |
gem 'newrelic_rpm' | |
end |
This file contains 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
# config/initializers/char_converter.rb | |
require 'uri' | |
module Support | |
class CharConverter | |
SANITIZE_ENV_KEYS = [ | |
"HTTP_COOKIE", # bad cookie encodings kill rack: https://github.com/rack/rack/issues/225 | |
"HTTP_REFERER", | |
"PATH_INFO", |
This file contains 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
# Don't write to Disk on Sleep | |
sudo pmset -a hibernatemode 0 | |
# Install Developer Tools (no XCode) | |
# https://developer.apple.com/downloads/index.action# | |
# Install DropBox | |
# Install 1Password | |
# Install Homebrew |