Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Weinberg no-stack-dub-sack

  • Greater NYC Area
View GitHub Profile
@no-stack-dub-sack
no-stack-dub-sack / auraSnippetsHTML.json
Last active Dec 10, 2018
A collection of VS Code for faster and more efficient Salesforce development (so far covering Lightning only).
View auraSnippetsHTML.json
{
"AuraValueBinding": {
"prefix": "aura:vb",
"body": [
"\"{!$0}\""
],
"description": "Aura value binding"
},
"AuraIteration": {
"prefix": "aura:iteration",
@no-stack-dub-sack
no-stack-dub-sack / example.md
Last active Mar 6, 2018
WebSQL Join Issues
View example.md

To show the true results of a join, we'd have to break SQL convention and not repeat column names across multiple tables. Rows are expressed as Objects, so if you are trying to join the following tables with the following columns:

orders_table
id  customer_id  stock_id

customers_table
id  address      state

stocks_table
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
View index.js
/*
...
a bunch of other code
...
*/
const defaultState = {
height: 600,
isMapPaneHidden: false,
@no-stack-dub-sack
no-stack-dub-sack / index.js
Last active Aug 9, 2018
Persist redux state to local storage
View index.js
import { store } from './fileWhereStoreLives';
// add this code in your app's entry point file to
// set localStorage when navigating away from app
window.onbeforeunload = function(e) {
const state = store.getState();
localStorage.setItem(
'local-storage-key',
JSON.stringify(state.stateYouWantToPersist)
);
@no-stack-dub-sack
no-stack-dub-sack / hijackConsole.js
Last active Nov 19, 2017
capture console.log messages with redux
View hijackConsole.js
import { store } from './index';
export const hijackConsole = () => {
const OG_LOG = console.log;
console.log = function(...args) {
// map over arguments and convert
// objects in to readable strings
const messages = [...args].map(msg => {
return typeof msg !== 'string'
? JSON.stringify(msg)