Skip to content

Instantly share code, notes, and snippets.

View csgregorian's full-sized avatar
🔥
git reset --hard

Christopher Gregorian csgregorian

🔥
git reset --hard
View GitHub Profile
class brushTool(Tool):
"""Draws continuous circles at a given size"""
def canvasDown(self):
global toolLoc
toolLoc = cm()
def canvasHold(self):
if key.get_pressed()[K_LCTRL] or key.get_pressed()[K_RCTRL]:
color = tuple(map(cc, hls(hue/255, 0.5, 1)))
else:
color = currentColour
def cmyk(color):
cmyk_scale = 100
r = color[0]
g = color[1]
b = color[2]
if (r == 0) and (g == 0) and (b == 0):
# black
return 0, 0, 0, cmyk_scale
#include <iostream>
#include <cstring>
using namespace std;
int main() {
int distance;
cin >> distance;
int strokes[5300];
a = [5,1,4,2,3]
b = [2,5,3,1,4]
num_shifts = 0
def f(i):
global a
if a[i] != b[i]:
cow = a[b.index(a[i])]
a[b.index(a[i])] = a[i]
jarcompile() {
jar cvfe $1.jar $1 *.class resources/*
echo -e "cd \$(dirname \$BASH_SOURCE)\njava -jar $1.jar\n" > $1.command
echo -e "java -jar $1.jar\n" > $1.bat
chmod +x $1.command
}
j() {
clear
echo "Compiling..."
javac $1.java
echo "Compiling complete! Running..."
java $1
echo "Running complete!"
}
### Keybase proof
I hereby claim:
* I am csgregorian on github.
* I am csg (https://keybase.io/csg) on keybase.
* I have a public key whose fingerprint is 5389 E696 FE01 731C 60AF 9669 C5A3 21A9 E252 61B2
To claim this, I am signing this object:
def sieve(n):
primes = []
sieve = [True] * (n + 1)
for p in range(2, n+1):
if sieve[p]:
primes.append(p)
for i in range(p ** 2, n + 1, p):
sieve[i] = False
function makeID(length) {
var text = '';
var possible = 'abcdefghijklmnopqrstuvwxyz0123456789';
for (var i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
// LinkedListTest.java
import java.util.*;
public class LinkedListTest {
public static void main(String[] args) {
LinkedList list = new LinkedList<Integer>(3);
list.print();
list.enqueue(4);
list.print();