Skip to content

Instantly share code, notes, and snippets.

@kevin-bruton
kevin-bruton / iterm2-solarized.md
Created Sep 22, 2021 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel10k

Powerlevel10k

View jupyter-as-a-desktop-app.md

How to run Jupyterlab as a desktop app on Mac OSX

Tired of opening terminal to launch Jupyterlab, and having to leave it opened all the time? Try to run Jupyterlab as a desktop app:

nativefier-jupyterlab

One of a benefits is avoiding the annoying accident: "closed Jupyterlab when quitting the browser".

1. Install Anaconda for mac

Run in Terminal

@kevin-bruton
kevin-bruton / Quantopian_Lectures.md
Last active Nov 8, 2020 — forked from ih2502mk/list.md
Quantopian Lectures Saved
View Quantopian_Lectures.md
@kevin-bruton
kevin-bruton / server.js
Created Jun 8, 2020 — forked from ryanoglesby08/server.js
A node.js SPA server that serves static files and an index.html file for all other routes.
View server.js
/*
Incredibly simple Node.js and Express application server for serving static assets.
Given as an example from the React Router documentation (along with examples
using nginx and Apache):
- https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory
*/
const express = require('express');
const path = require('path');
View deepCopy.js
const deepCopy = aObject => {
if (!aObject) { return aObject; }
const bObject = Array.isArray(aObject) ? [] : {};
// tslint:disable-next-line: forin
for (const k in aObject) {
bObject[k] = aObject[k] === null ? null : (typeof aObject[k] === 'object') ? deepCopy(aObject[k]) : aObject[k];
}
return bObject;
};
View nativeNodeServer.js
const http = require('http');
const url = require('url');
const fs = require('fs');
const path = require('path');
const port = process.argv[2] || 9000;
http.createServer(function (req, res) {
console.log(`${req.method} ${req.url}`);
// parse URL
@kevin-bruton
kevin-bruton / one-way-binding.js
Last active Feb 23, 2020
One way binding in native javascript
View one-way-binding.js
// data binding in native javascript:
// https://stackblitz.com/edit/databinding-native-js
// Example html:
// <span id="labelEl">default</span>: <span id="nameEl">default</span>
const setupBindings = bindings =>
bindings.reduce((acc, cur) =>
Object.defineProperty(acc, cur.bindingName, {
set: val => (cur.element[cur.attribute] = val)