This Week plan
- What I Am planing to do this week
- Complete Big Task 1123
- Big Task 2123
What Happened Last Week
- Last week plan
- Big Task 1
- Big Task 1123
import requests | |
def lookup_podcasts(search_term): | |
base_url = "https://itunes.apple.com/search" | |
params = { | |
"term": search_term, | |
"media": "podcast", | |
"limit": 10 # Adjust the limit as needed | |
} | |
import SwiftUI | |
extension Color { | |
static var random: Color { | |
return Color( | |
red: .random(in: 0...1), | |
green: .random(in: 0...1), | |
blue: .random(in: 0...1) | |
) | |
} |
This Week plan
What Happened Last Week
javascript:(function()%7Bvar%20video%20%3D%20document.getElementsByTagName('video')%5B0%5D%3Bvideo.play()%3Bvideo.webkitSetPresentationMode(video.webkitPresentationMode%20%3D%3D%3D%20%22picture-in-picture%22%20%3F%20%22inline%22%20%3A%20%22picture-in-picture%22)%7D)() |
from PIL import Image, ImageDraw | |
import random | |
from sys import argv | |
image_name = "" | |
if len(argv) != 4: | |
print("My have input, output and factor") | |
exit() | |
else: |
""" | |
The basic idea is that I loop through all characters and count the number of | |
pixels and make <Hashtable number of pixels as a key and character as value> | |
The table will not have 255 value so to cover this I had to calculate the | |
slope of change as a base step for the colors. | |
example, if we have 50 value and we need 255 value, then each 255/50 = 5.1 | |
Then with each gray color we will devied by 5 so we have index to | |
be fetched from the keys of the pixels table |
import os | |
from sys import argv | |
from Quartz import CGWindowListCopyWindowInfo, kCGWindowListExcludeDesktopElements, kCGNullWindowID,kCGWindowListOptionOnScreenOnly | |
windowList = CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID) | |
systemWindows = ['SystemUIServer', 'Window Server', 'Spotlight'] | |
searchname = argv[1].lower() | |
for i in windowList: | |
if searchname in i['kCGWindowOwnerName'].lower() and i['kCGWindowOwnerName'] not in systemWindows: | |
print(i['kCGWindowNumber'], i['kCGWindowOwnerName']) | |
os.system('screencapture -l{0} "tmp/{0}{1}.png"'.format(i['kCGWindowNumber'], i['kCGWindowOwnerName'])) |
from PIL import Image, ImageDraw | |
import sys | |
def rgb_2_pixels(fr, fg, fb, br, bg, bb, text='\u2584'): | |
fgc = "{0};{1};{2}".format(fr, fg, fb) | |
bgc = "{0};{1};{2}".format(br, bg, bb) | |
return "\033[38;2;{0};48;2;{1}m{2}\033[0m".format(fgc, bgc, text) | |
def morph_color(c1, c2): | |
return int((c1 + c2) / 2) |
extension UIView { | |
/// Example: call someView.nudge(0, 30) | |
func nudge(_ dx: CGFloat, _ dy: CGFloat) { | |
self.frame = self.frame.offsetBy(dx: dx, dy: dy) | |
CATransaction.flush() | |
} | |
} | |
extension UIView { | |
/// Example: po UIView.root |
from PIL import Image, ImageDraw | |
import random | |
from sys import argv | |
if len(argv) != 3: | |
print("<<script>> Image outputDir") | |
exit(1) | |
image_name = argv[1] | |
out = argv[2] |