Skip to content

Instantly share code, notes, and snippets.

View chand1012's full-sized avatar

Chandler chand1012

View GitHub Profile
@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
@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 / 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 / AttinyMotor.ino
Last active March 18, 2019 18:53
uses an ATTiny85 to drive a L293D driver
//L293D
//Motor A
#define motorPin1 5 // Pin 14 of L293
#define motorPin2 2 // Pin 10 of L293
//Motor B
#define motorPin3 3 // Pin 7 of L293
#define motorPin4 4 // Pin 2 of L293
//ping sensor
#define echoPin 0
@echo off
title youtube-dl script
set /p url="Past url to download:"
youtube-dl %url%
pause
desktop:=1
<^<!b::
Run, cmd
return
<^<!t::
run, git-bash.exe
return
@chand1012
chand1012 / bblayers.conf
Created May 30, 2019 12:01
Raspberry Pi Bitbake config files
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/user/rpi/sources/poky/meta \
/home/user/rpi/sources/poky/meta-poky \
@chand1012
chand1012 / bblayers.conf
Last active May 30, 2019 20:02
Intel x86 Bitbake files
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/user/yoctox86/sources/poky/meta \
/home/user/yoctox86/sources/poky/meta-poky \
@chand1012
chand1012 / comparetextfile.py
Created June 27, 2019 15:34
Compares two files and puts their common lines in a file called output.txt
import sys
def common_item(lista, listb, mode=0):
items = []
for x in lista:
for y in listb:
if x==y:
if not mode:
return True
if mode:
import math
def f(x): # change this to the function of your choice
squared = math.pow(x, 2)
return math.sqrt(squared+1)
a = 0 # start
b = 2 # end
n = 6 # increase for more accuracy
dx = (b-a)/n