Skip to content

Instantly share code, notes, and snippets.

View zombieleet's full-sized avatar
💭
Learning never exhausts the mind

Victory Osikwemhe zombieleet

💭
Learning never exhausts the mind
View GitHub Profile
@candlerb
candlerb / go-project-layout.md
Last active April 24, 2024 19:22
Suggestions for go project layout

If someone asked me the question "what layout should I use for my Go code repository?", I'd start by asking back "what are you building: an executable, or a library?"

Single executable

Stage 1: single source file

Create a directory named however you want your final executable to be called (e.g. "mycommand"), change into that directory, and create the following files:

@alinnert
alinnert / levelizeTree.js
Last active June 30, 2021 09:31
A function that flattens a tree structure while preserving nesting information
const { map, flatMapDeep, add, flow } = require('lodash/fp')
const data = [
{
id: 1,
type: 'group',
name: 'Colors',
items: [
{ id: 2, type: 'item', name: 'Red' },
{ id: 3, type: 'item', name: 'Purple' },
@kjkuan
kjkuan / bashflow.sh
Created February 26, 2017 20:40
For-All Each-Do Success Fail
#!/usr/bin/env bash
#
# This is a hack that allows you to express loop and conditional processing
# of an array of items in terms of function definitions.
#
# My initial motivation came from the need to process an array of items, and
# then for those successfully processed items, do another different processing
# step, and similarly for the failed items; perform further processing/filtering
# steps for each failed/successful items.
#
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@caridy
caridy / export-syntax.js
Last active January 15, 2022 14:22
ES6 Module Syntax Table
// default exports
export default 42;
export default {};
export default [];
export default foo;
export default function () {}
export default class {}
export default function foo () {}
export default class foo {}