CoffeeScript | JS | |||
---|---|---|---|---|
Single Quotes | ? | Never | ||
Double Quotes | Always | |||
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
{ | |
"editor.dragAndDrop": false, | |
"editor.fontFamily": "'IBM Plex Mono Light'", | |
"editor.lineHeight": 20, | |
"editor.minimap.enabled": false, | |
"editor.renderIndentGuides": false, | |
"editor.roundedSelection": false, | |
"editor.rulers": [100, 120], | |
"editor.tabSize": 2, | |
"files.trimTrailingWhitespace": 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
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim | |
# Compiled on Jul 20 2017 | |
mkdir ~/vim && cd ~/vim && curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz && export VIMRUNTIME="$HOME/vim/runtime" && export PATH="$HOME/vim:$PATH" && cd - |
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 BatchJobStateful | |
extend ActiveSupport::Concern | |
included do | |
field :current_batch_id, type: String | |
field :last_batch_total, type: Integer | |
field :last_batch_failures, type: Integer | |
field :last_batch_created_at, type: Time | |
field :last_batch_completed_at, type: Time | |
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
module Mongoid | |
# Mongoid extension which stores all fetched records in a memory cache | |
module TimestampCacheable | |
extend ActiveSupport::Concern | |
class QueryNotCacheableError < StandardError; end | |
module ClassMethods | |
def queryable | |
scope_stack.last || TimestampCacheableCriteria.new(self) |
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 MyCollection extends Backbone.Collection | |
classExtend(@, ModuleCollectionAsOptions) | |
# works | |
new MyCollection().toOptionsJSON() |
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 String | |
def self.similarity(a, b) | |
if a == b | |
return a.length | |
end | |
result = 0 | |
while a[result] == b[result] | |
result += 1 | |
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
"custom_fields": [ | |
{ | |
"id": "513fba45deeed40200000250", | |
"field_type": "select", | |
"display_label": "Primary CTA", | |
"name": "primary call to action", | |
"created_at": "2013-03-12T23:29:10Z", | |
"select_values": [ | |
"Read More", | |
"Subscribe", |
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
{ | |
"operation":"create", | |
"type":"content", | |
"payload":{ | |
"full_post":{ | |
"id":"523381424aaaaecc80000001", | |
"idea_title":null, | |
"content_title":null, | |
"creator_id":"51e477b9e1f419ecf4000004", | |
"assignee_id":"51e477b9e1f419ecf4000004", |
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
def create_success_message | |
result = @created_events.reduce("Post updated,") do |m, ev| | |
case ev.class | |
when PostAssignedEvent | |
m += " assigned to #{ev.assignee.name}," | |
when PostArchivedEvent | |
m += " archived," | |
when PostUnassignedEvent | |
m += " assigned user cleared," | |
when PostProposedEvent |
NewerOlder