Skip to content

Instantly share code, notes, and snippets.

View KShaibani's full-sized avatar
🚀

Khaled KShaibani

🚀
View GitHub Profile
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active May 22, 2024 15:35 — 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

@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active May 16, 2024 01:54
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;
@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;
@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
@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)
@cobbpg
cobbpg / Unity-hotswapping-notes.md
Last active February 17, 2024 19:04
Unity hotswapping notes

Unity hotswapping notes

Unity has built-in support for hotswapping, which is a huge productivity booster. This feature works not only with graphics assets like bitmaps and meshes, but also with code: if you edit the source and save it, the editor will save the state of the running game, compile and load the new code, then load the saved state and continue where it left off. Unfortunately, this feature is very easy to break, and most available 3rd party plugins have little regard for it.

It looks like there’s a lot of confusion about hotswapping in Unity, and many developers are not even aware of its existence – which is no wonder if their only experience is seeing lots of errors on the console when they forget to stop the game before recompiling... This document is an attempt to clear up some of this confusion.

Nota bene, I’m not a Unity developer, so everything below is based on blog posts and experimentation. Corrections are most welcome!

The basic flow of hotswapping

@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
@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
@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;