Skip to content

Instantly share code, notes, and snippets.

View D0NM's full-sized avatar
💢
Coding beat 'em up 'Zabu' for Sega Genesis

Mikhail Bratus D0NM

💢
Coding beat 'em up 'Zabu' for Sega Genesis
View GitHub Profile
@shekhirin
shekhirin / navalny.py
Last active January 21, 2021 18:14
https://youtu.be/ipAnwilMncI in YouTube trends all over the world
import requests
from tqdm import tqdm
countries_response = requests.get('https://api.popular50.com/countries').json()
countries = [x['_id'] for x in countries_response['hits']]
data = {x: requests.get('https://api.popular50.com/v1videos', params={'country_code': x, 'category_id': 0}).json() for x in tqdm(countries)}
naval = {x: [i for i, z in enumerate(y['hits']) if z['_source']['video_id'] == 'ipAnwilMncI'] for x, y in data.items()}
countries_data = {x['_id']: x for x in countries_response['hits']}
print('\n'.join([f'{x[0]} – {x[1][0] + 1}' for x in sorted({countries_data[x]['_source']['country_name']: y for x, y in naval.items() if len(y) > 0}.items(), key=lambda x: x[1][0])]))
@jakebesworth
jakebesworth / main.lua
Last active November 1, 2023 19:50 — forked from Leandros/main.lua
Love2D 11.X Fix Your Timestep! "Free the physics" 4th approach
--[[
Original Author: https://github.com/Leandros
Updated Author: https://github.com/jakebesworth
MIT License
Copyright (c) 2018 Jake Besworth
Original Gist: https://gist.github.com/Leandros/98624b9b9d9d26df18c4
Love.run 11.X: https://love2d.org/wiki/love.run
Original Article, 4th algorithm: https://gafferongames.com/post/fix_your_timestep/
Forum Discussion: https://love2d.org/forums/viewtopic.php?f=3&t=85166&start=10
#items { overflow: hidden !important; }
*:not(.yt-chat-badge):not(.yt-emoji-icon) { background: transparent !important; }
.gaming-promo, #live-comments-controls, ::-webkit-scrollbar, wbr, .is-deleted, [is-deleted], #panel-pages, yt-live-chat-header-renderer { display: none !important; }
#author-name, #message { color: white !important; text-shadow: -0.5px -0.5px 0 black, 0.5px -0.5px 0 black, -0.5px 0.5px 0 black, 0.5px 0.5px 0 black !important; }
#message { display: block !important; }
#author-name::after { content: ":"; font-weight: 900; }
#message a {color: skyblue !important; font-size: 0 !important; line-height: 9px !important;}
#message a::after { content: attr(href); font-size: 10px !important; }
@keyframes chat-fade { 0% { opacity: 1; position: relative; } 99% { opacity: 0; position: relative; } 100% { opacity: 0; position: absolute; }}
yt-live-chat-text-message-renderer { animation: chat-fade 5s 30s forwards; }
@kaeza
kaeza / bitty.lua
Last active November 18, 2021 01:38
Bitty - Implementation of bitwise operators in pure Lua
if false then -- For LuaDoc
---
-- Pure Lua implementation of bitwise operations.
-- Not suitable for time critical code. Intended as fallback
-- for cases where a native implementation is unavailable.
-- Further optimization may be possible.
-- @version 0.1
-- @author kaeza <https://github.com/kaeza>
module "bitty"
@y2bd
y2bd / twitterer.lua
Last active May 19, 2016 11:53
Twitter URL generator for Lua
local tweet, map, appendparam, encode
local Twitterer = setmetatable({tweet=tweet}, {__call = function(t, params) return tweet(params) end})
tweet = function(params)
text = params[1] or params.text or nil
url = params[2] or params.url or nil
via = params[3] or params.via or nil
hashtags = params[4] or params.hashtags or nil
related = params[5] or params.related or nil