Skip to content

Instantly share code, notes, and snippets.

View influx6's full-sized avatar
🎯
Focusing

Ewetumo Alexander influx6

🎯
Focusing
View GitHub Profile
@influx6
influx6 / restart-ssh.bash
Last active December 16, 2023 09:26
Restart SSH on Mac Terminal (High Sierra)
# high sierra
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd
# latest
sudo vim /etc/services # (update the port config for ssh and save)
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
# Unix (Terminal)
open -a "Google Chrome" --args --disable-gpu-vsync --disable-frame-rate-limit
# Windows (Command prompt)
start chrome --args --disable-gpu-vsync --disable-frame-rate-limit
@influx6
influx6 / ContentView.swift
Created August 23, 2023 23:07 — forked from alexwidua/ContentView.swift
SwiftUI Grid Animation
import SwiftUI
// 1. Use looped H/VStacks to create a grid
// 2. Conditionally increase spacing to grow/shrink the grid
// 3. Calculate the distance of each dot to the center and use the value to stagger the animation
//4. Add random delay on top of the staggered delay value
struct ContentView: View {
// const & state
@influx6
influx6 / setup.md
Last active July 3, 2023 12:16 — forked from akella/setup.md
WEBGL Tools Setuo
@influx6
influx6 / write-an-open-source-js-lib.md
Created April 22, 2023 16:15 — forked from oncode/write-an-open-source-js-lib.md
How to Write an Open Source JavaScript Library
////////////////////////////////////////////////////////////////////////////////
// Create a directory called "pages" next to
// this file, put markdown files in there, and
// then run:
//
// ```
// $ node build.mjs
// ```
//
// Then deploy the "build" directory somewhere.
@influx6
influx6 / nativemocks.js
Created August 8, 2019 02:28
Native Mocks for Jest
import 'react-native'
export const MockNativeEventEmitter = () => {
return () => {
const EventEmitter = require('EventEmitter')
const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter')
/**
* Mock the NativeEventEmitter as a normal JS EventEmitter.
*/
@influx6
influx6 / min-char-rnn.py
Created January 10, 2023 15:02 — 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)
@influx6
influx6 / flush-iptables.sh
Created December 31, 2022 08:34 — forked from mrclay/flush-iptables.sh
Flush IP tables and restart docker
#!/bin/bash
# Script is needed because my default firewall rules are messed up and after
# every restart, docker containers can't make connections to the host, notably
# preventing debuggers like xdebug from attaching.
# If networking fails in your containers but works in others, rm and re-create the
# docker network that container is bound to.
set -euo pipefail
@influx6
influx6 / mspqueue.go
Created October 21, 2018 10:45
MSP Queue
package mailbox
import (
"sync/atomic"
"unsafe"
"github.com/gokit/actorkit"
)
// MSQueue provides an efficient implementation of a multi-producer, single-consumer lock-free queue.