| CoffeeScript | JS | |||
|---|---|---|---|---|
| Single Quotes | ? | Never | ||
| Double Quotes | Always | |||
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
| // hedgedTransport implements a hedged HTTP transport that sends multiple | |
| // requests if a previous request takes too long, with a specified timeout | |
| // between attempts. | |
| type hedgedTransport struct { | |
| // Transport is the underlying RT used to actually make the requests. | |
| transport http.RoundTripper | |
| // Timeout is the interval between initiating hedged requests. | |
| timeout time.Duration | |
| // MaxAttempts is the total number of requests (1 original + n-1 hedges). | |
| maxAttempts int |
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
| name: Delete All Webhooks | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| secrets: | |
| GH_TOKEN: | |
| required: true | |
| schedule: | |
| - cron: '0 0 * * SAT' |
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
| { | |
| "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 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
| # 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 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
| 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 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
| 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 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
| class MyCollection extends Backbone.Collection | |
| classExtend(@, ModuleCollectionAsOptions) | |
| # works | |
| new MyCollection().toOptionsJSON() |
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
| 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 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
| "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", |
NewerOlder