Skip to content

Instantly share code, notes, and snippets.

View kristianfreeman's full-sized avatar
🙃

Kristian Freeman kristianfreeman

🙃
View GitHub Profile
@kristianfreeman
kristianfreeman / metadata.sh
Last active December 13, 2023 16:45
Restore metadata for files created using Ultimate Vocal Remover GUI - more details here: https://github.com/Anjok07/ultimatevocalremovergui/issues/394#issuecomment-1854286668
#!/bin/bash
# Loop over all files in the current directory with the format "{number}_{filename}_(Instrumental).flac"
for file in *.flac; do
# Extract the filename without the number and '(Instrumental)' part
filename=$(echo "$file" | sed -E 's/^[0-9]+_(.*)_\(Instrumental\)\.flac/\1/')
# Construct the path of the matching file in the parent directory
parent_file="../${filename}.flac"
call plug#begin('~/.vim/plugged')
Plug 'christoomey/vim-tmux-navigator'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'dracula/vim'
Plug 'edkolev/tmuxline.vim'
Plug 'ntpeters/vim-better-whitespace'
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
image:
registry: docker.io
repository: bitnami/ghost
tag: 2.6.0
pullPolicy: IfNotPresent
volumePermissions:
image:
registry: docker.io
repository: bitnami/minideb
# https://github.com/kylestetz/slang
@bass (adsr (osc saw) 0 0.5 0 0.5) + (filter lp 20)
play @bass (rhythm [8n 16n 8n 16n r16n]) (notes [e1 e2 e1 d2])
@pluck (adsr (osc saw) 0 0.05 0 0)
play @pluck (rhythm [16n]) (notes [e4 d4 e4 g4])
@doot (adsr (osc square) 0 0.04 0.1 0) + (filter lp 20)
play @doot (rhythm [r16n 16n 16n 16n]) (notes [e2 e2 e2 d3 g3 a3])

This is the "Redux manufacturing" project, which simulates a warehouse that accepts orders, prepares them for delivery, and ships them. It's built with React and Redux.

The project starts with an existing codebase built without Redux. We'll integrate Redux and react-redux, move the component-level functions into reducers, and define actions to be dispatched from the component to make these state changes happen.

What needs to happen

A number of functions are defined in the top-level component, App.js. These functions are passed in as props to various components, and are called to update the App component's state.

We need to move each of these functions into the Redux reducer function, ensure that they are pure functions, and define the appropriate actions (and constants) to be able to dispatch those actions from components.

@kristianfreeman
kristianfreeman / vimrc
Created December 14, 2016 23:15
vimrc from "Learn how to use Vim"
" Pathogen setup
runtime bundle/vim-pathogen/autoload/pathogen.vim
" Bundle: tpope/vim-pathogen
call pathogen#infect()
" Bundles
"
" Bundle: tpope/vim-sensible
" Bundle: tpope/vim-rails
" Bundle: tpope/vim-fugitive
def index(conn, %{“hub.verify_token” => verify_token, “hub.challenge” => challenge}) do
resp =
case verify_token do
“helloworld” -> challenge
_ -> “notok”
end
text conn, resp
end
defmodule SampleApp.WebhookController do
use SampleApp.Web, :controller
def index(conn, _params) do
json conn, %{status: “ok”}
end
end
scope “/api”, SampleApp do
pipe_through :api
get “/webhook”, WebhookController, :index
end
@kristianfreeman
kristianfreeman / now.md
Last active September 29, 2016 23:50
kristianfreeman.com/now
  • Working at Simple, as part of the Frontend team. Work with us, it's really great here!
  • Meditating, daily. Headspace is great for this.
  • Doing less things! My stress level was through the roof during the middle of this year: I took on too many projects and didn't give myself enough time to relax.

(borrowed idea and format from the always amazing Derek Sivers)