Skip to content

Instantly share code, notes, and snippets.

View chand1012's full-sized avatar

Chandler chand1012

View GitHub Profile
@chand1012
chand1012 / catalan.py
Created October 13, 2018 03:14
Catalan's constant calculator in python
# Simple Catalan's Constant implimentation in python
# Written for some homework, hope someone else finds it useful
# n being the times the number is calculated, increasing n increases accuracy
from fractions import Fraction
n = int(raw_input("enter N:"))
k = 1
sum = 0
sign = 1
while True:
@chand1012
chand1012 / temps.py
Created February 20, 2018 18:19
Get CPU and GPU temps from Windows with Python and OHM
import wmi
def avg(value_list):
num = 0
length = len(value_list)
for val in value_list:
num += val
return num/length
@chand1012
chand1012 / buttons.css
Last active December 21, 2017 18:21
Simple yet ellegant CSS buttons
//from https://codepen.io/simonbusborg/pen/cyxad
// converted from scss to css
:root {
--color-dark: #161616;
--color-ocean: #416dea;
--color-grass: #3dd28d;
--color-snow: #fff;
--color-salmon: #f32c52;
--color-sun: #feee7d;
@chand1012
chand1012 / sfxCopy.py
Created November 18, 2017 06:07
A script to copy sound effects between Pico-8 Carts
# Created by Chandler Lofland aka chand1012
# Licensed as CC 3.0 US
# This script is to copy sfx between carts in pico8
# Uses basic file commands in python and sys for arguments
# For Python 3.0+
# arguments go like so: python sfxcpy.py <inputFile> <outputFile>
import sys
args = sys.argv
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
echo Installing Discord
apt install libgconf-2-4 libappindicator1
cd ~/Downloads
wget -O discord-0.0.2.deb https://discordapp.com/api/download?platform=linux&format=deb
sudo dpkg -i discord-0.0.2.deb
@chand1012
chand1012 / auto-update.pyw
Last active August 8, 2017 16:27
Python Git repo auto updater
import os, sys
from easygui import *
title = "Git Auto Update"
msg = "Do you want to update your Git Repos?"
if not ynbox(title, msg):
sys.exit()
print('Getting list of directories...')
@chand1012
chand1012 / settings.json
Created May 21, 2017 12:32
Settings file for my project WinGuake
{"color": "color 0a", "minimize": "min", "exit": "exit"}
@chand1012
chand1012 / launch.bat
Created May 16, 2017 02:08
My batch script for my modded Minecraft server
:: this is the file that handles the server for my modded Minecraft on my 6-core PC
:: ParallelGCThreads can be changed to accomodate any number of cores, just give it the number of threads needed
:: if you are hosting a vanilla server, change forge.jar to the name of the Minecraft server jar
:: change Xmx to the amount of RAM your computer has
:: change 'world3' to the name of your Minecraft world to backup the world automatically
:: lines 10, 13-15 have to do with automatic restart on crash
@echo off
color 0a
title MWServer
:a
@chand1012
chand1012 / WebCrawler.rb
Created May 15, 2017 02:12
Web Crawler made in ruby. Designed for Wikipedia.
require 'rest-client'
require 'nokogiri'
require 'random_methods'
require 'os'
#v1.1: Added help section
#v1.2: Fixed bug with Ruby 2.2.3
#v1.3: Added change log
wikiLink = "wikipedia.org"
urlList = Array.new
url = nil
@chand1012
chand1012 / keyboard.json
Created May 14, 2017 03:34
Windows VK keys 1-9, a-z
{
"0": "0x30",
"1": "0x31",
"2": "0x32",
"3": "0x33",
"4": "0x34",
"5": "0x35",
"6": "0x36",
"7": "0x37",
"8": "0x38",