node dirtyserve.js
The point your browser to
http://localhost:3000/myfile.xxx
and the server will try to serve that file from the local server.
const fetch = require('node-fetch') | |
const Bacon = require('baconjs') | |
function getInPortuguese(word) { | |
// Google Translate API is a paid (but dirt cheap) service. This is my key | |
// and will be disabled by the time the video is out. To generate your own, | |
// go here: https://cloud.google.com/translate/v2/getting_started | |
const apiKey = | |
'AIzaSyB4DyRHIsNhogQXmH16YKbZfR-lTXrQpq0' | |
const url = |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Intro to XState</title> | |
<link rel="stylesheet" href="styles.css" /> | |
</head> | |
<body> | |
<div id="box"></div> |
const isMoreThan5 = number => number > 5 | |
const numbers = [ 2, 4, 8, 9 ] | |
const result = filter(isMoreThan5, numbers) | |
const addThree = number => number + 3 | |
const result = map(addThree, numbers) | |
result | |
function map(transform, array) { | |
const initialArray = [] | |
const mapReducer = (mappedArray, currentItem) => |
# handy little script i wrote to compress the enourmous image folder my girlfriend had, | |
sudo port install ImageMagick | |
find . -type f -name '*.jp*' -exec mogrify -resize '1280>' -compress jpeg -quality 85 {} \; |
someOrder = { | |
items: [ | |
{ name: 'Dragon food' , price: 8, quantity: 8 }, | |
{ name: 'Dragon cage (small)', price: 800, quantity: 2 }, | |
{ name: 'Shipping', price: 40, shipping: true } | |
] | |
} | |
orderTotal = (order) => { | |
totalNormalItems = |
This is code from an episode of Fun Fun Function: https://youtu.be/6sQDTgOqh-I
This week I tweeted and tooted this question:
”What do you think are critical traits in a programmer? NOT to be super 10x or anything - just to feel good and function well professionally.”
Link to full threads here: [https://twitter.com/mpjme/status/855691565460848640]
import React, { useEffect, useState } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import { Map, TileLayer, Marker, Popup, Tooltip } from 'react-leaflet' | |
import tmi from 'tmi.js' | |
// https://nominatim.openstreetmap.org/search?format=json&q=stockholm,sweden | |
// Firebase App (the core Firebase SDK) is always required and must be listed first | |
import * as firebase from "firebase/app" |
import React, { useEffect, useState } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import { Map, TileLayer, Marker, Popup, Tooltip } from 'react-leaflet' | |
import tmi from 'tmi.js' | |
// !<command> <args> ? !register Sweden ? | |
// !checkin SE I am streaming |