Skip to content

Instantly share code, notes, and snippets.

View gregorypease280's full-sized avatar

Gregory Pease gregorypease280

  • Los Angeles, California
View GitHub Profile
@gregorypease280
gregorypease280 / zed_venv.sh
Created April 4, 2023 23:30
zed venv config
#Gets the current venv path and creates the pyrightconfig for zed
#activate your venv then run it
cofig_file_name="pyrightconfig.json"
current_venv="${current_venv:-$(basename ${VIRTUAL_ENV})}"
current_venv_path="${current_venv_path:-$(builtin cd ${VIRTUAL_ENV}; pwd)}"
project_path="${project_path:-./}"
config_path="${project_path}${cofig_file_name}"
config_venv="${config_venv:-${current_venv}}"
config_venv_path="${config_venv_path:-${current_venv_path}}"

Keybase proof

I hereby claim:

  • I am gregorypease280 on github.
  • I am gregmindshow (https://keybase.io/gregmindshow) on keybase.
  • I have a public key ASBgSZuCDF7KzL8ebLRIq5Msz3ThWi2vaHI82nOW9llAJAo

To claim this, I am signing this object:

@gregorypease280
gregorypease280 / TopCoder SRM 144 DIV 1 300pt problem
Created August 10, 2014 07:04
TopCoder SRM 144 DIV 1 300pt problem
#include <iostream>
#include <vector>
#include <string>
#include <stdlib.h>
using namespace std;
class BinaryCode
{
public:
@gregorypease280
gregorypease280 / TabGrabber.py
Last active August 29, 2015 14:04
TabGrabber.py
# Made for Pythonista
#Grabs Tabs from UG, no annoying banners
#simply copy the link to the clipboard and run it
#
#
#
import httplib
import clipboard
from bs4 import BeautifulSoup
import string
@gregorypease280
gregorypease280 / ReadHeadlines.py
Last active August 29, 2015 14:04
ReadHeadlines.py
#Made for Pythonista
#Reads the titles of reddit posts, fun little pythonista demo of BS4 and the speech module
#If anyone has any tips on how to ensure proper text encoding please leave a comment!
#
#
#
import httplib
import speech
import console
from bs4 import BeautifulSoup
from scene import *
import textwrap
class Window(Layer):
def __init__(self, _bounds, background=Color(0.5,0.6,0.7),closeable=True, draggable=True, image=None):
Layer.__init__(self,_bounds)
self.bounds=_bounds
self.background=background
@gregorypease280
gregorypease280 / DodgeBall.py
Last active August 29, 2015 14:04
DodgeBall.py
#A simple game for Pythonista
from scene import *
import console
import random
import sound
from time import time
class Enemy:
#Euler Problem #11:
#In the 2020 grid below, four numbers along a diagonal line have been marked in red.
#08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
#49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
#81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
#52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91
#22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80
#24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50
#32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70
#The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
#Find the sum of all the primes below two million.
#all primes past 5 are 6n+- 1
#lets use this no?!
import time
def Sum(lim):
primes = [0] * lim
#A Pythagorean triplet is a set of three natural numbers, a b c, for which,
#a2 + b2 = c2
#For example, 32 + 42 = 9 + 16 = 25 = 52.
#There exists exactly one Pythagorean triplet for which a + b + c = 1000.
#Find the product abc.
#a=1000-b-c
#
# I COULD generate the entire sert of pythagorean triplets BUT I would have to use multiple algorithms to