Skip to content

Instantly share code, notes, and snippets.

Avatar

Alan Pierce alangpierce

  • Benchling
  • San Francisco, CA
View GitHub Profile
@alangpierce
alangpierce / soak-examples.txt
Created Jan 24, 2018
Examples of undeclared global accesses in CoffeeScript soak operations
View soak-examples.txt
Example from SwitchyOmega/omega-target-chromium-extension/src/coffee/background.coffee:
168 | state = new OmegaTargetCurrent.BrowserStorage(localStorage, 'omega.local.')
169 |
> 170 | if chrome?.storage?.sync or browser?.storage?.sync
| ^^^^^^
171 | syncStorage = new OmegaTargetCurrent.Storage('sync')
172 | sync = new OmegaTargetCurrent.OptionsSync(syncStorage)
Example from SwitchyOmega/omega-target-chromium-extension/src/coffee/background.coffee:
View parse.js
parse(response) {
response.features = new selectables.Collection(response.features);
return response;
}
View parse.coffee
parse: (response) ->
response.features = new selectables.Collection(response.features)
return response
View clear-workspace-2.js
_clearWorkspace(itemIdsToKeep) {
if (itemIdsToKeep == null) { itemIdsToKeep = []; }
this._closeAllFilesExcept(itemFileId => itemIdsToKeep.includes(itemFileId));
}
View clear-workspace.js
_clearWorkspace(itemIdsToKeep) {
if (itemIdsToKeep == null) { itemIdsToKeep = []; }
this._closeAllFilesExcept(itemFileId => Array.from(itemIdsToKeep).includes(itemFileId));
}
View clear-workspace.coffee
_clearWorkspace: (itemIdsToKeep = []) ->
@_closeAllFilesExcept (itemFileId) -> itemFileId in itemIdsToKeep
return
View note-editor.js
/* eslint-disable
camelcase,
consistent-return,
default-case,
func-names,
new-cap,
no-case-declarations,
no-cond-assign,
no-multi-assign,
no-return-assign,