Skip to content

Instantly share code, notes, and snippets.

View Jeff-Lewis's full-sized avatar

Jeff Lewis Jeff-Lewis

  • StreetConnect & SchoolBee
  • NYC
View GitHub Profile
@guimondmm
guimondmm / Anaconda PowerShell Prompt in Windows Terminal settings.json
Last active April 5, 2024 19:50
Add an "Anaconda PowerShell Prompt" profile to Windows Terminal. Just paste it in your settings.json file.
{
"colorScheme": "Campbell",
"commandline": "pwsh.exe -ExecutionPolicy ByPass -NoExit -Command \"& '%USERPROFILE%\\anaconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%USERPROFILE%\\anaconda3' \"",
"guid": "{e7d34d61-5a57-4f38-8eab-91cb777b0c26}",
"hidden": false,
"icon": "%USERPROFILE%\\anaconda3\\Menu\\anaconda-navigator.ico",
"name": "Anaconda PowerShell Prompt",
"startingDirectory": "%USERPROFILE%"
}
@morristech
morristech / reinstall_git_brew.md
Created November 28, 2017 06:32 — forked from brandonsimpson/reinstall_git_brew.md
Re-installing Git on Mac OSX with Brew

Re-installing Git on Mac OSX with Brew

This is helpful if you've previously installed git from source on OSX, and other compilers can't find the correct path. You need to remove the current version of git, then re-install with brew.

Uninstall git if installed manually

  1. Check which git you're running:
    which git
    
// Custom made dynamoose declaration file.
declare module "dynamoose" {
export function local(url: string): void;
export function model<DataSchema, KeySchema, ModelSchema extends Model<DataSchema>>(
modelName: string,
schema: Schema,
options?: ModelOption
): ModelConstructor<DataSchema, KeySchema, ModelSchema>;
export function setDefaults(options: ModelOption): void;
@aaaristo
aaaristo / newer.js
Last active October 10, 2018 14:09
a "ThreadLocal"-like context for asynchronous callback domains
function isIterator(obj)
{
return obj&&obj.next&&obj.throw;
}
function isRunWithContext(obj)
{
return obj&&typeof obj=='function'&&obj.ctx;
}
@mhevery
mhevery / Zone.md
Last active March 30, 2022 11:54
TC39 Zone Proposal

Zone Motivation

Make writing asynchronous code easier by having a consistent way of propagating "context" across related asynchronous operations. Have the "context" be responsible for async-local-storage, allowing the execution before and after hooks, and "context"-local error handling. Finally make sure that the "context"s are composable.

This feature needs to be part of the platform so that library and framework authors can relay on a common well know API, otherwise adoption will be limited.

@trevnorris
trevnorris / proper_code_column_length.txt
Last active August 9, 2016 20:38
Quick notes on why constraining cpl is an advantage when writing source
While the standard 80 character limit for source code can be traced back to the
IBM punch card[1] it can still be seen as a good upper bound for how long lines
of text should be on modern high definition displays.
First thing we must acknowledge is that source code is not read in the
traditional sense. Instead developers scan the source using non-linear eye
movements[2] or stay fixated in a small area of code while working out the
logical details of code being written. The fixation on a single location, even
for more than a few seconds, leads to a loss of visual accuity. Which occurs
when the eyes do not perform frequent saccadic eye movements.[3] Further
@dgieselaar
dgieselaar / gist:8b20e9d593e1806a098b
Last active July 5, 2017 10:39
Code splitting, lazy-loading, import statements, Angular + newNgRouter + ocLazyLoad + webpack
import _ from 'lodash';
import angular from 'angular';
import 'angular-new-router';
import 'oclazyload';
function AppController ( ) {
}
AppController.$routeConfig = [];

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@brianmacarthur
brianmacarthur / flash-app.js
Last active July 10, 2023 18:41
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@addyosmani
addyosmani / composition.md
Last active January 23, 2016 21:39
JS Musings

Composition

On an architectural level, the way we craft large-scale applications in JavaScript has changed in at least one fundamental way in the last four years. Once you remove the minutia of machinery bringing forth data-binding, immutable data-structures and virtual-DOM (all of which are interesting problem spaces) the one key concept that many devs seem to have organically converged on is composition. Composition is incredibly powerful, allowing us to stitch together reusable pieces of functionality to "compose" a larger application. Composition eschews in a mindset of things being good when they're modular, smaller and easier to test. Easier to reason with. Easier to distribute. Heck, just look at how well that works for Node.

Composition is one of the reasons we regularly talk about React "Components", "Ember.Component"s, Angular directives, Polymer elements and of course, straight-up Web Components. We may argue about the frameworks and libraries surrounding t