In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
| 10-Bit H.264 | |
| For all those who haven’t heard of it already, here’s a quick rundown about the | |
| newest trend in making our encodes unplayable on even more systems: So-called | |
| high-bit-depth H.264. So, why another format, and what makes this stuff | |
| different from what you know already? | |
| First off: What is bit depth? | |
| In short, bit depth is the level of precision that’s available for storing color | |
| information. The encodes you’re used to have a precision of 8 bits (256 levels) |
| #!/bin/bash | |
| export DISPLAY=:0 | |
| gsettings set org.gnome.Vino enabled true | |
| gsettings set org.gnome.Vino prompt-enabled false | |
| gsettings set org.gnome.Vino require-encryption false | |
| /usr/lib/vino/vino-server & |
Exhaustive list of SPDX (Software Package Data Exchange) licenses: https://spdx.org/licenses/
Check git repo size : git count-objects -v
First checkout to the commit, which you want to make as the initial commit. Then run the following commands :
git checkout --orphan temp_branch
git add -A
git commit -am "Initial commit message"
git branch -D main
git branch -m main
I am removing .env file from local git history.
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD
To push this to remote,
git push --force
| class Base(object): | |
| def __init__(self): | |
| print("Base init'ed") | |
| class ChildA(Base): | |
| def __init__(self): | |
| print("ChildA init'ed") | |
| Base.__init__(self) | |
| class ChildB(Base): |
| function memorySizeOf(obj) { | |
| var bytes = 0; | |
| function sizeOf(obj) { | |
| if(obj !== null && obj !== undefined) { | |
| switch(typeof obj) { | |
| case 'number': | |
| bytes += 8; | |
| break; | |
| case 'string': |
This gist has most of the things I've used to develop the frontend using vite inside a monolithic django app.
A couple of things to note:
| // html | |
| // <input type="file" onchange="imagesSelected" multiple accept=".gif,.jpg,.jpeg,.png" /> | |
| async function imagesSelected(event) { | |
| let files = [...event.target.files]; | |
| let images = await Promise.all(files.map(f=>{return readAsDataURL(f)})); | |
| //all images' base64encoded data will be available as array in images | |
| } | |
| function readAsDataURL(file) { |