Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Doing a thing.

Elijah Lucian ELI7VH

💭
Doing a thing.
View GitHub Profile
View antd - useFormState.ts
// TO USE THIS:
import { useEffect, useState } from 'react'
import { FormInstance } from 'antd/lib/form'
type Props<T> = {
form: FormInstance<T>
id: string // some unique identifier that matches whatever you're editing
}
View reaction diffusion test.java
class Agent {
float a;
float b;
Agent(float _a, float _b) {
a = _a;
b = _b;
}
@ELI7VH
ELI7VH / dankbot.py
Created May 13, 2020
The Dankest of twitch bots!!
View dankbot.py
#!/usr/bin/env python
import socket,sys,subprocess,os,json,pygame,time,bs4,requests,random,fnmatch,urllib,tweepy,datetime,sqlite3
from glob import glob
print 'dankbot is born...'
#establish working and database paths
homedir = '/home/pi/dankbot/'
dirsb = '/home/pi/soundboard/'
db_file = '/var/www/dank.db'
@ELI7VH
ELI7VH / react-context-boilerplate.tsx
Last active Apr 23, 2020
React Context Boiler Plate - Typescript
View react-context-boilerplate.tsx
import React, { createContext, useContext, useState, useEffect } from "react"
type Props = {
children: React.ReactNode
}
type Context = {
count: number
increment: () => void
}
@ELI7VH
ELI7VH / example-nginx-react-router-express-api-sockets-https.conf
Last active Oct 6, 2019
Example nginx create-react-app react router api socket.io with https
View example-nginx-react-router-express-api-sockets-https.conf
server {
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
View stars.p8
function _init()
cls()
print("stars")
t = 0
stars = {}
for i=1,25 do
add(stars,agent.new(i))
end
for s in all(stars) do
s:reset()
@ELI7VH
ELI7VH / fragmentShader.glsl
Last active Jul 1, 2019
Outrun Sun Fragment Shader
View fragmentShader.glsl
uniform float time;
varying vec2 vUv;
void main() {
vec3 color = vec3(1.0);
float sun = step(mod(vUv.y * 20. + time, 1.), -0.2 + 0.35 * vUv.y * 3.7);
color.x *= sun;
color.y *= sun * (0.6 + vUv.y - 0.7 );
color.z = 0.;
You can’t perform that action at this time.