Skip to content

Instantly share code, notes, and snippets.

@CoolOppo
CoolOppo / optimal-video-to-gif-imagemagick.md
Last active November 7, 2023 15:24
Converting videos to GIFs optimally using ImageMagick

ImageMagick Video to GIF Optimization Summary

A software developer who uses IM to create Movie GIFs, Benoit Rouleau, in discussion with me, gave me a AVI video of a plane flying over, to help us mutually explore IM video conversion techniques.

However while the AVI itself is quite small, the uncompressed video is a

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/descriptor.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "google/protobuf/descriptor.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
/*************************************************************
Copyright 2005-2007 Hacker Factor, All Rights Reserved.
By Neal Krawetz, www.hackerfactor.com
jpegquality:
Estimate the quality of the JPEG based on the quantization tables.
Neal's personal comment...
"Jpeg, and Exif in particular, is one of the most screwed up formats
that I have ever seen."

[[ data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//CABEIBA0EPwMBEQACEQEDEQH/xAAcAAACAwEBAQEAAAAAAAAAAAAAAQIDBAUGBwj/2gAIAQEAAAAA+0gA0AAAAAAAAAAkogJJxwc2uFNUKaoZubZGFdddVcYqMYwqr0fZNskJqvlcKydujRIbnY4VV1cn5p5zueS732jTGp8yl6pyZIEmoxX2MYmAgBgmmmmmAAAkiKEhBVx8caqoV001c/NOMKoV0VKMYqFWelfbt99s3JU8Xz91l2i6wcp2FdUKsvm9t2LwvtPUV0rkFuqbGOIIio/WVJAwQAMQAADTE0AkkhIQqOJmjVXXCmqviWuuFUK6KlFRjCmiqr7f2W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cIV1Vef3xrhTCmmEYkI101U0/ZPUybahVg8tpndovm3KVqrrqrVNWW7SyMMXNejVMYhoSUT6wmhgCAGgAABpiECEhEQQcrk1UwjXCFeXi7o1wpjRRGKiQpqroo+oe2AnOqGbyuqd2i+ciU7IwrqrVNWa7UOMcHMno0TYIaQkl9YAE0AA0AAADTQhNJxERBC8/jpphCEY18/DdGMK66KoJRVdddWfP9O99CM3TVZR5XTOzVfNuVlkK666ymnLfqGQ5/NlqvkwBCEKP1dgmJoGIAGCAaAEnEEIi0ivzNVFUalGEebjmlCuumuEVGNca6c+f6T9KIuddUM3ktM569ElOdkq4111qHlaPTaXIhzubLXfIYIERRH6w

Source Multiplayer Networking

From Valve Developer Community

Multiplayer games based on the Source Engine use a Client-Server networking architecture. Usually a server is a dedicated host that runs the game and is authoritative about world simulation, game rules, and player input processing. A client is a player's computer connected to a game server. The client and server communicate with each other by sending small data packets at a high frequency (usually 20 to 30 packets per second). A client receives the current world state from the server and generates video and audio output based on these updates. The client also samples data from input devices (keyboard, mouse, microphone, etc.) and sends these input samples back to the server for further processing. Clients only communicate with the game server and not

JavaScript Scoping and Hoisting

Do you know what value will be alerted if the following is executed as a JavaScript program?

var foo = 1;
function bar() {
	if (!foo) {
 var foo = 10;
/*
* Chemical equation balancer
*
* Copyright (c) 2014 Project Nayuki
* All rights reserved. Contact Nayuki for licensing.
* http://www.nayuki.io/page/chemical-equation-balancer-javascript
*/
"use strict";
@CoolOppo
CoolOppo / bkr.bash
Created December 31, 2014 00:53
Backgrounds a command, disowns it, and hides all of its output
# Background function to run any given command in the background and
# disown it from the shell, hiding ALL output:
bkr ()
{
(nohup "$@" &>/dev/null &)
}

MISC

  • Fixed masks drawing through smoke.
  • Fixed grenades getting stuck in chickens.
  • Doom sticker is no longer invisible.
  • A VAC error message will now take the user to a KB article to help resolve the error.