Skip to content

Instantly share code, notes, and snippets.

@phrawzty
phrawzty / 2serv.py
Last active May 2, 2024 12:27
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@CannonballSkippy
CannonballSkippy / Video-and-Subtitle-merger-batch-for-mkvmerge.bat
Created May 15, 2017 13:27
This is a batch script that will merge subtitles with a video file, resulting in an *.mkv file with internal subtitles.
@echo off
echo ----------------------------------------------------------------------
echo VIDEO AND SUBTITLE MERGER
echo version 1.0.0 by Seyoum
echo ----------------------------------------------------------------------
:: Set file video extention
:VIDEOFILEEXTENTION
echo.
set /p videofileformat=Enter the video file type extension (e.g mp4):
if /I "%videofileformat%" EQU "webm" echo You have chosen %videofileformat% as your video file format&goto:SUBTITLEFILEEXTENTION
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 2, 2024 12:25
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

#!/bin/sh
#
# Postgresql backup script
# http://www.bitweaver.org/wiki/pg_backup+PostgreSQL+backup+script
#
# Author
# |
# +-- speedboy (speedboy_420 at hotmail dot com)
# +-- spiderr (spiderr at bitweaver dot org)
# +-- flexiondotorg (code at flexion dot org)
@peterwwillis
peterwwillis / git-prune.sh
Created July 28, 2018 18:58
Prune Git's local orphan references, merged feature branches, remote tracking references, and more
#!/bin/bash
# Prune local orphan refs
git prune -v
# Deletes all stale (local) remote-tracking branches under origin.
# These stale branches have already been removed from the remote repository
# referenced by <name>, but are still locally available.
git remote prune origin
@Zekfad
Zekfad / conventional-commits.md
Last active May 2, 2024 12:23
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@johnathanmay
johnathanmay / logitech-mx-master-3-extras-for-linux-with-logiops.md
Last active May 2, 2024 12:23
How to install and configure PixlOne's logid to program Logitech MX Master 3 buttons on Linux.

Logitech MX Master 3 Extras for Linux With logiops

The Logitech Options program isn't available for Linux, but by a nice guy on GitHub (PixlOne) created an open source project that lets you obtain some of that functionality. It's called logiops. It works in conjunction with the Solaar project as well, which I find especially handy since that shows your available battery life in the system tray and lets you pair/unpair devices with the Logitech Unifying Receiver.

Here are some additional pages with info that I used to generate this documentation:

@mid-kid
mid-kid / pdf-full-merge.js
Created October 18, 2023 21:39
Merge all attributes of multiple PDF files using MuPDF
// Merge all attributes of multiple PDF files (pdf-full-merge.js)
// Extended from MuPDF's docs/examples/pdf-merge.js
// Ever had problems with tools that don't copy certain attributes of a PDF?
// This script uses MuPDF to merge/join/concatenate as much as possible, including:
// - bookmarks / outlines / table of contents
// - link attributes of said outlines, such as viewrect and zoom
// - whether outlines appear open or closed by default
// - annotations
// - 3d objects / PDF3D
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs