(Jan 2, 2021) Ask HN: Successful one-person online businesses in 2021?
https://news.ycombinator.com/item?id=25614966
(Dec 12, 2020) Ask HN: Successful one-person online businesses?
from itertools import permutations | |
from random import choice as randchoice | |
og_names = ['a', 'b', 'c', 'd'] # secret santa choices | |
names, recipients = [], [] | |
def set_names(): | |
global names | |
global recipients |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"image" | |
"image/color" | |
"image/draw" | |
"image/jpeg" | |
"log" |
(Jan 2, 2021) Ask HN: Successful one-person online businesses in 2021?
https://news.ycombinator.com/item?id=25614966
(Dec 12, 2020) Ask HN: Successful one-person online businesses?
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
import argparse | |
import logging | |
import zipfile | |
from pathlib import Path | |
logger = logging.getLogger(__name__) | |
class Error(Exception): | |
pass |
package main | |
import ( | |
"runtime" | |
"fmt" | |
"time" | |
) | |
func main() { | |
// Print our starting memory usage (should be around 0mb) |
// Component.js | |
const Component = props => ( | |
<MyContext.Consumer> | |
{(context) => ( | |
<Foo | |
bar={props.bar} | |
baz={context.baz} | |
/> | |
)} | |
</MyContext.Consumer> |
import cProfile | |
import pstats | |
prof = cProfile.Profile() | |
prof.run('<YOUR CODE>') | |
prof.sort_stats('cumtime') | |
prof.dump_stats('output.prof') | |
stream = open('output.txt', 'w') | |
stats = pstats.Stats('output.prof', stream=stream) |
# In CPython implementation of Python 3.6, dictionary keeps the insertion order. | |
# From Python 3.7, this will become a language feature. | |
# In order to sort a dictionary by key including nested dictionary inside, we can do: | |
def sort_dict(item: dict): | |
""" | |
Sort nested dict | |
Example: | |
Input: {'a': 1, 'c': 3, 'b': {'b2': 2, 'b1': 1}} | |
Output: {'a': 1, 'b': {'b1': 1, 'b2': 2}, 'c': 3} |
{ | |
"emojis": [ | |
{"emoji": "👩👩👧👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👧👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👦👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👨👩👧👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |