Skip to content

Instantly share code, notes, and snippets.

View Glyphack's full-sized avatar
🔨
Building Enderpy

Shaygan Hooshyari Glyphack

🔨
Building Enderpy
View GitHub Profile
{
"speakers": [{
"title" : "Art in Full Bloom",
"name": "Lorenzo Garcia",
"shortname" : "Lorenzo_Garcia",
"summary" : "Drawing and painting flowers may seem like a first-year art student's assignment, but Lorenzo Garcia brings depth, shadows, light, form and color to new heights with his unique and revolutionary technique of painting on canvas with ceramic glaze. This session is sure to be a hit with mixed media buffs.",
"description": "<p>Lorenzo was born in Mexico, but grew up in Southern California after his mother immigrated to Los Angeles when he was a year old. His mother worked as a seamstress in the Fashion District and brought home scrap materials for Lorenzo to create his early mixed media art. From that point on, Lorenzo became hooked on creating art from scrap metals, fabrics, wood, canvas, and many others. During his junior year at Bischon Art School in Los Angeles, he perfected his own proprietary method of painting on canvas with ceramic glaze, which he will demonstrate on
@Glyphack
Glyphack / auto_comment_bot
Created January 20, 2019 11:23
auto instagram comment bot
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from time import sleep
from ast import literal_eval
import random
from selenium.webdriver.support import ui
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import WebDriverException
@Glyphack
Glyphack / time_sort.py
Last active April 25, 2019 11:48
Implementing sorting with async.sleep
import asyncio
import time
import random
async def task(i):
await asyncio.sleep(i* 0.01)
print(i)
async def main():
a = [random.randint(0, 100) for _ in range(0, 100)]
coroutines = list()
@Glyphack
Glyphack / graphql_test_utils.py
Created August 23, 2019 14:18
functions to test graphql api with python
from django.contrib.auth.models import AnonymousUser
from django.test import RequestFactory
from snapshottest.django import TestCase
from graphene.test import Client
from hackernews.schema import schema
class APITestCase(TestCase):
def setUp(self):
@Glyphack
Glyphack / test_schema.py
Created August 23, 2019 14:36
graphql test case
from django.contrib.auth import get_user_model
from utils.test_utils import APITestCase
from .graphql_requests import (
CREATE_LINK_MUTATION
)
class LinkTestCase(APITestCase):
def setUp(self):
@Glyphack
Glyphack / 2fa.py
Created August 8, 2020 18:11
a script to copy steam 2fa code into clipboard
from steampy import guard
import pyperclip
pyperclip.copy(guard.generate_one_time_code("shared secret"))
@Glyphack
Glyphack / avro_schema_to_swagger.py
Last active September 1, 2022 10:39
Generate openapi swagger object definition form avro schema
"""
Convert Avro schema files to swagger object definitions.
"""
import argparse
import json
from dataclasses import dataclass
from typing import Dict, List
parser = argparse.ArgumentParser(
description="Convert avro schema file to swagger object definition"
@Glyphack
Glyphack / channels_blocking.go
Created March 11, 2023 15:22
Golang: Wait group, channels, blocking operation
package main
import (
"fmt"
"sync"
)
func main() {
ch := make(chan int)
wg := sync.WaitGroup{}
@Glyphack
Glyphack / game-of-life.go
Created May 29, 2023 14:59
Game of life in go
package main
import "fmt"
type Cell struct {
x int
y int
state int
}
@Glyphack
Glyphack / print_symbol_table.py
Created August 18, 2023 19:22
Script to print symbol table of a python code
import symtable
def print_symbol_table_info(symbol_table: symtable.SymbolTable, indent=0):
# Print the information of the current symbol table
print(" " * indent + f"Symbol Table: {symbol_table.get_name()}")
print(" " * (indent + 2) + f"Type: {symbol_table.get_type()}")
print(" " * (indent + 2) + f"Identifier: {symbol_table.get_id()}")
print(" " * (indent + 2) + f"First Line Number: {symbol_table.get_lineno()}")
# print(" " * (indent + 2) + f"Is Optimized: {symbol_table.is_optimized()}")
# print(" " * (indent + 2) + f"Is Nested: {symbol_table.is_nested()}")