Skip to content

Instantly share code, notes, and snippets.

View no-stack-dub-sack's full-sized avatar

Peter Weinberg no-stack-dub-sack

  • Brooklyn, NY
  • 16:35 (UTC -04:00)
View GitHub Profile
@no-stack-dub-sack
no-stack-dub-sack / Program.cs
Created October 15, 2021 01:51
Minimal repro for .net issue
using Microsoft.AspNetCore.HttpLogging;
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpContextAccessor();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddHttpLogging(opts =>
@no-stack-dub-sack
no-stack-dub-sack / auraSnippetsHTML.json
Last active December 10, 2018 00:03
A collection of VS Code for faster and more efficient Salesforce development (so far covering Lightning only).
{
"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 March 6, 2018 02:32
WebSQL Join Issues

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
# 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 ->
@no-stack-dub-sack
no-stack-dub-sack / index.js
Last active January 4, 2018 04:19
Panes/redux
/*
...
a bunch of other code
...
*/
const defaultState = {
height: 600,
isMapPaneHidden: false,
@no-stack-dub-sack
no-stack-dub-sack / index.js
Last active February 26, 2024 15:29
Persist redux state to local storage
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 November 19, 2017 18:02
capture console.log messages with redux
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)
@no-stack-dub-sack
no-stack-dub-sack / binary-search-tree.md
Created October 28, 2017 15:53
binary search tree image

image