Skip to content

Instantly share code, notes, and snippets.

View tyliec's full-sized avatar
:octocat:
"furiously typing on keyboard"

Tyler Chong tyliec

:octocat:
"furiously typing on keyboard"
View GitHub Profile
@tyliec
tyliec / test-cluster.conf
Last active February 3, 2023 06:38
Test Cluster Conf
[cluster]
mysql-master = githubapp030
redis-master = githubapp030
mysql-auto-failover = false
primary-datacenter = usspk01
[cluster "githubdata025"]
hostname = githubdata025
rack = US.RMR.02.01.0309.07.011
@tyliec
tyliec / bot.js
Created July 19, 2020 01:11
Discord Speech to Text Bot
// Starter Code: https://gist.github.com/eslachance/3349734a98d30011bb202f47342601d3#file-index_v12-js
const Discord = require("discord.js");
const speech = require('@google-cloud/speech');
const fs = require('fs');
/*
DISCORD.JS VERSION 12 CODE
*/
const client = new Discord.Client();
from sklearn.datasets import make_blobs
import numpy as np
import matplotlib.pyplot as plt
import random
import math
def plot_k_means(x, r, k, centers):
#random_colors = np.random.random((k, 3))
#colors = r.dot(random_colors)
#colors = ('black')
@tyliec
tyliec / soft-kmeans.py
Created May 12, 2019 08:41
soft k-means
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
def plot_k_means(x, r, k, centers, colors):
# print(r[:20])
# plt.scatter(x[:,0], x[:,1], c=('red', 'blue', 'green'))
# plt.scatter(x[:,0], x[:,1], c=('black', 'black', 'black'))
plt.scatter(x[:,0], x[:,1], c=colors)
@tyliec
tyliec / k-means.py
Created April 19, 2019 17:39
K-means
# import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
X = -2 * np.random.rand(100, 2)
X1 = 1 + 2 * np.random.rand(50, 2)
X[50:100, :] = X1
plt.scatter(X[:,0], X[:,1], s = 50, c = 'b')
@tyliec
tyliec / perceptron.py
Last active February 14, 2019 10:05
python3 please
import numpy as np
import random
import matplotlib.pyplot as plt
class Perceptron(object):
def __init__(self, no_of_inputs, threshold=100, learning_rate=0.01):
self.threshold = threshold
self.learning_rate = learning_rate
self.weights = np.zeros(no_of_inputs + 1)
@tyliec
tyliec / perceptron.py
Created February 7, 2019 22:53 — forked from Thomascountz/perceptron.py
Perceptron in Python v.1
import numpy as np
class Perceptron(object):
def __init__(self, no_of_inputs, threshold=100, learning_rate=0.01):
self.threshold = threshold
self.learning_rate = learning_rate
self.weights = np.zeros(no_of_inputs + 1)
def predict(self, inputs):
@tyliec
tyliec / Terraria.md
Last active August 11, 2020 13:52
Terraria Server Setup Guide

This is a Terraria Server Setup Guide for Digital Ocean

This guide might not do everything the right way, but it works.

No bullshit. Straight up what I did to get it working. (Ubuntu 16.04 64bit)

ssh into your droplet

Update your shit