Skip to content

Instantly share code, notes, and snippets.

View hashier's full-sized avatar
🦆

Christopher Loessl hashier

🦆
View GitHub Profile
# Convert from H264 to H265
ffmpeg -i in.mov -c:v libx265 -an -x265-params crf=20 output.mp4
# Tag as HVC instead of HEV1 so iOS can play it
ffmpeg -i output.mp4 -vcodec copy -acodec copy -tag:v hvc1 output2.mp4
# Bonus: it can take a second to play (no more than H264) so here's how to generate
# a thumbnail of the first frame to embed in your view as a placeholder.
ffmpeg -i output2.mp4 -vf "select=eq(n\,34)" -vframes 1 thumbnail.png
@jazzyisj
jazzyisj / package_unavailable_entities.yaml
Last active November 10, 2024 14:38
Unavailable Sensor Detection and Notification
#######################################################################################################################
# The Unavailable Entities Sensor Package has been moved to it's own repository!
# https://github.com/jazzyisj/unavailable-entities-sensor
#######################################################################################################################
@blinry
blinry / mpv-memento.lua
Created October 29, 2017 00:20
Put this into ~/.mpv/scripts/, then press M while playing a movie to turn on "Memento mode"
is_on = false
step = 5*60 -- seconds
overlap = 10 -- seconds
function recalc()
local pos = mp.get_property_number("time-pos")
local duration = mp.get_property_number("duration")
next_seek = math.ceil((pos+1)/step)*step+overlap
if next_seek > duration then
next_seek = duration-1
<?php
header('Location: https://setcookie.net');
@jaysudodeveloper
jaysudodeveloper / Good taste.md
Created December 27, 2016 06:26 — forked from santisbon/Good taste.md
What makes good taste?

On Good Taste

Linus Torvalds in an interview talked about the idea of good taste in code or what I like to call elegance. As one might expect from two slides meant to make a point during a talk, he omits a lot of details to keep it short and simple. This post digs into the specifics of his example (deleting an element from a list) and adds another example (inserting an element in a list) including working code.

Example from Linus

This is an example of removing an element from a singly-linked list. It's one of the first data structures you learn about when you start learning about computer science and programming. The reason it doesn't show particularly good taste is because we have that condition at the end where we take a different action depending on whether the element we want to remove is at the beginning of the list or somewhere in the middle.

![Bad taste](http://

@santisbon
santisbon / Good taste.md
Last active July 13, 2023 15:16
What makes good taste? #linux #linus #torvalds

On Good Taste

Linus Torvalds in an interview talked about the idea of good taste in code or what I like to call elegance. As one might expect from two slides meant to make a point during a talk, he omits a lot of details to keep it short and simple. This post digs into the specifics of his example (deleting an element from a list) and adds another example (inserting an element in a list) including working code.

Example from Linus

This is an example of removing an element from a singly-linked list. It's one of the first data structures you learn about when you start learning about computer science and programming. The reason it doesn't show particularly good taste is because we have that condition at the end where we take a different action depending on whether the element we want to remove is at the beginning of the list or somewhere in the middle.

![Bad taste](http://

Update: download the new Pokemon Go app - it fixes all of this. Download it, and reauth, and you should be set. The grant scopes and prompt are correct and visible now too! Now if only I could actually find a pikachu...

Pokemon tokens are requested with these understandable scopes:

anonymous
anonymous / gist:de6b81c556b5dc7cdc8b
Created February 20, 2015 01:42
Kernel panic in latest OS X in 10 lines of C
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach-o/dyld.h>
int
main (int argc, char * argv[])
{
volatile char * library;
const mach_vm_size_t page_size = getpagesize ();
@StefanPetrick
StefanPetrick / crosswipe
Created December 6, 2014 15:59
cross wipe
// the animation itself
// basically just moves the noise in 2 dimensions
// and oscillates the border for the mapping methods
void CrossNoise2() {
currentPalette = RainbowStripeColors_p;
noisesmoothing = 20;
y[0] += 100;
#if 1
- (id)retain {
NSUInteger oldRetainCount = [super retainCount];
id result = [super retain];
NSUInteger newRetainCount = [super retainCount];
printf("%s<%p> ++retainCount: %lu => %lu\n", [[self className] UTF8String], self, oldRetainCount, newRetainCount);
printf("%s\n", [[[NSThread callStackSymbols] description] UTF8String]);
return result;
}