Skip to content

Instantly share code, notes, and snippets.

View idling-mind's full-sized avatar

Najeem Muhammed idling-mind

View GitHub Profile
@idling-mind
idling-mind / zenlauncher
Created December 10, 2020 10:48
A Simple GNOME launcher in 20 lines of code
#!/bin/bash
# Config file stores all the commands as csv data
configfile=$HOME/.config/zenlauncher/applist.csv
configdir=$(dirname $configfile)
# Create the config file if it's not existing and add the first command
if [ ! -f $configfile ] ;
then
mkdir -p $configdir
from random import choice
from PIL import Image, ImageDraw
from colorlovers import get_top_pallet
from draw_shapes import draw_circle
scale_factor = 4 # Resize scaling for antialiasing
img_size = (1920, 1080) # Final image size desired
img_size_scaled = tuple(x*scale_factor for x in img_size)
from random import choice
from PIL import Image, ImageDraw
from colorlovers import get_top_pallet
from draw_shapes import draw_circle
scale_factor = 4 # Resize scaling for antialiasing
img_size = (1920, 1080) # Final image size desired
img_size_scaled = tuple(x*scale_factor for x in img_size)
@idling-mind
idling-mind / colorlovers.py
Created July 29, 2020 22:01
Getting a top pallet from colorlovers.com
from xml.etree import ElementTree as et
import requests
def get_top_pallet(rank):
"""Get a top ranked pallete from colorlovers.com
Args:
rank (int): The rank of the pallet in the website.
Starting with 0.
from PIL import Image, ImageDraw
scale_factor = 4 # Resize scaling for antialiasing
img_size = (1920, 1080) # Final image size desired
img_size_scaled = tuple(x*scale_factor for x in img_size)
img = Image.new("RGB", img_size_scaled)
ic = ImageDraw.Draw(img, "RGBA") # Specified RGBA
from PIL import Image, ImageDraw
scale_factor = 4 # Resize scaling for antialiasing
img_size = (500, 500) # Final image size desired
img_size_scaled = tuple(x*scale_factor for x in img_size)
img = Image.new("RGB", img_size_scaled)
ic = ImageDraw.Draw(img, "RGBA") # Specified RGBA
from random import randint
from PIL import Image, ImageDraw
scale_factor = 4 # Resize scaling for antialiasing
img_size = (500, 500) # Final image size desired
img_size_scaled = tuple(x*scale_factor for x in img_size)
img = Image.new("RGB", img_size_scaled)
ic = ImageDraw.Draw(img)
from PIL import Image, ImageDraw
scale_factor = 4 # Resize scaling for antialiasing
img_size = (500, 500) # Final image size desired
img_size_scaled = tuple(x*scale_factor for x in img_size)
img = Image.new("RGB", img_size_scaled)
ic = ImageDraw.Draw(img)
@idling-mind
idling-mind / pilwall_basic.py
Created July 29, 2020 12:41
Drawing basic circle in PIL
from PIL import Image, ImageDraw
img = Image.new("RGB", (500, 500))
ic = ImageDraw.Draw(img)
ic.ellipse([0, 0, 500, 500], fill="RED")
img.save("basic.png")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.