Skip to content

Instantly share code, notes, and snippets.

View KShaibani's full-sized avatar
🚀

Khaled KShaibani

🚀
View GitHub Profile
@aabiji
aabiji / yt.py
Created April 7, 2024 15:39
Youtube video downloader
"""
A tiny youtube video downloader.
usage: yt.py [-h] [--only-audio] [--num_retries NUM_RETRIES] [--output OUTPUT] video_url
Built by Abigail Adegbiji on April 7, 2024.
Inspried by this blog post: https://tyrrrz.me/blog/reverse-engineering-youtube-revisited
Note that the get_video_info function will be subject to change when Youtube changes their api.
Also note that ffmpeg and ffmpeg-python are required dependencies.
"""
@Washi1337
Washi1337 / TinySharp.cs
Last active April 18, 2024 12:32
A program to emit a tiny .NET binary program printing Hello World to the standard output. Blog post: https://blog.washi.dev/posts/tinysharp/
using System.Text;
using AsmResolver;
using AsmResolver.DotNet;
using AsmResolver.DotNet.Builder.Metadata.Blob;
using AsmResolver.DotNet.Builder.Metadata.Strings;
using AsmResolver.DotNet.Code.Cil;
using AsmResolver.DotNet.Signatures;
using AsmResolver.IO;
using AsmResolver.PE;
using AsmResolver.PE.DotNet.Builder;
@simonbs
simonbs / AppKitTextView.swift
Created January 27, 2023 08:39
Shows how a multi-platform SwiftUI can bridge to UIKit and AppKit.
// Implementation of the view using AppKit.
#if os(macOS)
import AppKit
import SwiftUI
final class AppKitTextView: NSView {
let textView: NSTextView = {
let this = NSTextView()
this.translatesAutoresizingMaskIntoConstraints = false
return this
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active May 1, 2024 20:04 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Last updated: April 2024

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

@LouisAmon
LouisAmon / json_to_gzip.py
Created July 26, 2018 12:49
How to compress JSON-able data using gzip (Python 3)
import json
import gzip
def compress_data(data):
# Convert to JSON
json_data = json.dumps(data, indent=2)
# Convert to bytes
encoded = json_data.encode('utf-8')
# Compress
compressed = gzip.compress(encoded)
@FullStackForger
FullStackForger / .gitattributes
Last active July 5, 2023 17:59 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
# Unity
*.cginc text
*.cs diff=csharp text
*.shader text
# Unity YAML
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@dvddarias
dvddarias / SingletonScriptableObject.cs
Last active December 20, 2021 14:29
Better Unity Singleton Class
/************************************************************
* Better Singleton by David Darias
* Use as you like - credit where due would be appreciated :D
* Licence: WTFPL V2, Dec 2014
* Tested on Unity v5.6.0 (should work on earlier versions)
* 03/02/2017 - v1.1
* **********************************************************/
using System;
using UnityEngine;
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active April 2, 2024 18:56
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
@taylorhughes
taylorhughes / user-agents.txt
Last active April 6, 2024 16:07
A list of iOS embedded webview User-Agents
SAFARI 10.0.1
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1
CHROME on 10.0.1
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.86 Mobile/14A403 Safari/601.1.46
FACEBOOK MESSENGER
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A403 [FBAN/MessengerForiOS;FBAV/87.0.0.24.69;FBBV/38293694;FBRV/0;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iPhone OS;FBSV/10.0.1;FBSS/2;FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5]
TWITTER FOR IPHONE
void Main()
{
var pushId = FirebasePushIDGenerator.GeneratePushID();
Console.WriteLine(pushId);
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());
Thread.Sleep(5);
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());
Thread.Sleep(5);
Console.WriteLine(FirebasePushIDGenerator.GeneratePushID());