Skip to content

Instantly share code, notes, and snippets.

Zip excluding specific directories

Exclude .git file and node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/\*

Exclude .git file and files in node_modules directory, but keep node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/**\*
@Skyblueballykid
Skyblueballykid / .md
Created April 17, 2022 06:07 — forked from nilsalm/.md
Installing Elixir on Mac M1 July 2021

Installing Elixir on Mac M1 July 2021

I recently got excited about functional programming and wanted to learn more and then my friend recommended I check out Elixir. I tried to install it and got stuck for so many hours that I nearly gave up. Nearly. Here's how I pulled it together, if I remember the steps correctly

How it didn't work

First, I was so excited that I just jumped on youtube and followed a tutorial from 2017 that started with installing Erlang from their official homepage. That didn't quite work once I tried brew install elixir so I got rid of that erlang again and installed the whole thing through homebrew. This continued to give me Segmentation Faults every time I started erl or elixir -v.

@Skyblueballykid
Skyblueballykid / readme-mde.md
Created April 9, 2022 04:10 — forked from ThePredators/readme-mde.md
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment (Tested on macOS M1+Intel)

Install HomeBrew

## Install xcode utils
xcode-select --install
## Install Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@Skyblueballykid
Skyblueballykid / aws-ami2-ec2-redis-cli.md
Created April 1, 2022 03:17 — forked from lesstif/aws-ami2-ec2-redis-cli.md
install redis-cli on AWS AMI2 without redis server
#!/bin/bash
sudo yum install gcc -y
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make MALLOC=libc
# Credit for this: Nicholas Swift
# as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2
from warnings import warn
import heapq
class Node:
"""
A node class for A* Pathfinding
"""
@Skyblueballykid
Skyblueballykid / astar.py
Created September 13, 2021 17:20 — forked from jamiees2/astar.py
A* Algorithm implementation in python.
# Enter your code here. Read input from STDIN. Print output to STDOUT
class Node:
def __init__(self,value,point):
self.value = value
self.point = point
self.parent = None
self.H = 0
self.G = 0
def move_cost(self,other):
return 0 if self.value == '.' else 1
@Skyblueballykid
Skyblueballykid / README.md
Created August 6, 2021 22:29 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@Skyblueballykid
Skyblueballykid / React_D3.md
Created July 30, 2021 22:24 — forked from alexcjohnson/LICENSE
Working with React and D3 together

React + D3

The key challenge in integrating D3 code into a React app is how to break up responsibility for DOM manipulation, so the two frameworks don’t step on each others’ toes yet updates are efficient and reliable. There are a lot of ways to go about this and which is best may depend on the specifics of your application. The key is to draw a very clear line between the responsibilities of React and D3 and never let either one cross into the other’s territory. React will always provide the overarching structure, D3 the details of the chart, but the exact boundary can be drawn in several places.

One other note - most of the discussion below (except for example react-faux-dom which is tailored to D3) applies just as well to integrating other packages or JS components inside a React app.

Approaches

Lifecycle methods wrapping regular D3 code:

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@Skyblueballykid
Skyblueballykid / min-char-rnn.py
Created May 10, 2018 15:32 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)