Skip to content

Instantly share code, notes, and snippets.

@DusanBrejka
DusanBrejka / ffmpeg-format-to-mimetype.js
Last active November 28, 2023 05:12
FFMPEG - map of formats to default mime types
// INCOMPLETE
// This command will give you list of available FFMPEG formats and their default Mime types
// ffmpeg -formats -hide_banner | tail -n +5 | cut -c5- | cut -d' ' -f1 | xargs -i{} ffmpeg -hide_banner -h demuxer={} | pcregrep -o2 -o4 -M '(Muxer (\w+) )|(Mime type:( .*).)'
// And then parse the output with regex to JSON format in JavaScript for example:
// str.match(/(.*)\n (.*)/gm).map(m => `"${m.replace(/\n /, '": "')}"`).join(',\n');
// Combine the output with MDN - Common MIME types
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
// And with IANA:
@Jesse-Culver
Jesse-Culver / optimizationInSourceEngine.md
Last active May 5, 2022 23:01
This is a basic run down of mapping optimization in the Source 1 Engine.

Optimization in the Source Engine is a critical component of mapping that not only makes your map compile faster but run better in game. However the two results are not always related.

"Why does it take so long for my map to compile?" The short answer is Source uses an optimization method called Binary Space Partitioning. The way this works is by cutting your map up into sections called leaves based on your brushes and then calculating what is in each leaf and then what leaves each leaf can see.

If you want a really good easy to follow explanation watch this video and this video


For optimizing in Source follow these in order and by the end you should have a fairly good understanding of how to optimize your map for performance and compile time. This is something you are going to have to practice

@JayKickliter
JayKickliter / interlaced_ntsc.v
Last active December 2, 2023 13:32
NTSC in Verilog
module interlaced_ntsc (
input wire clk,
input wire [2:0] pixel_data, // 0 ( black )..5 (bright white)
output wire h_sync_out, // single clock tick indicating pixel_y will incrememt on next clock ( for debugging )
output wire v_sync_out, // single clock tick indicating pixel_y will reset to 0 or 1 on next clock, depending on the field ( for debugging )
output wire [9:0] pixel_y, // which line
output wire [9:0] pixel_x,
output wire pixel_is_visible,
output reg [2:0] ntsc_out
@CoolOppo
CoolOppo / time-to-frequency.ipynb
Created October 19, 2019 07:11
How to extract frequencies with numpy using the real discrete fourier transform
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@k06a
k06a / log_2_rand_0_1.sol
Last active August 25, 2022 14:56
log_2_rand_0_1
/*
* ABDK Math 64.64 Smart Contract Library. Copyright © 2019 by ABDK Consulting.
* Author: Mikhail Vladimirov <mikhail.vladimirov@gmail.com>
*/
pragma solidity ^0.5.7;
/**
* Modified version of this code:
* https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L366
*
@AndrewJakubowicz
AndrewJakubowicz / Cargo.toml
Last active December 20, 2022 15:05
Specs Roguelike
[package]
name = "specs-roguelike"
version = "0.1.0"
authors = ["youCodeThings"]
edition = "2018"
[dependencies]
tcod = "0.13"
specs = "0.14.0"
@CoolOppo
CoolOppo / Cargo.toml
Last active January 2, 2024 10:27
How to compile to a DLL in rust while using it as a normal rust library
[package]
name = "test"
version = "0.1.0"
authors = ["YOU <YOU@users.noreply.github.com>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
@CoolOppo
CoolOppo / CompileAndMinify.ps1
Created December 3, 2018 20:54
Fast, parallel, web build script. Written by me in PowerShell.
workflow compileAndMinify {
$jsFiles = Get-ChildItem -Recurse -Include *.js -Exclude *.min.js
parallel {
sequence {
$scssFiles = Get-ChildItem -Recurse -Include *.scss
ForEach -Parallel ($file in $scssFiles) {
$dir = (Get-Item $file).Directory.FullName
$cmd = ("sass """ + $($file.FullName) + """ """ + $dir + "\" + $file.BaseName + ".css""")
Invoke-Expression $cmd
}
@CoolOppo
CoolOppo / .clang-format
Last active August 20, 2018 13:26
My clang-format style
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
@athiyadeviyani
athiyadeviyani / tkinterlist.py
Created July 19, 2018 08:27
Python GUI cheatsheet
# BASIC TKINTER CHEATSHEET
# Build basic GUIs with Python
from tkinter import *
from tkinter import scrolledtext
from tkinter import messagebox
from tkinter.ttk import Progressbar
from tkinter import filedialog
from tkinter import Menu