Skip to content

Instantly share code, notes, and snippets.

View jepio's full-sized avatar
🏠
Working from home

Jeremi Piotrowski jepio

🏠
Working from home
View GitHub Profile
@shift
shift / rpi4_eufi_booting_flatcar.md
Created December 2, 2020 09:21
UEFI/iPXE booting Raspberry Pi for Flatcar Linux

UEFI/iPXE booting Raspberry Pi for Flatcar Linux

Download and compile the following https://github.com/pftf/RPi4.git. I made the following change to edk2-platforms to always enable 3GB RAM+ as TFTP booting this seems to cause issues with it remembering the options.

diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc
index c481c35342..4b495b1fe8 100644
--- a/Platform/RaspberryPi/RPi4/RPi4.dsc
+++ b/Platform/RaspberryPi/RPi4/RPi4.dsc
@@ -495,7 +495,7 @@
@neilmayhew
neilmayhew / update-oem-vmware.sh
Last active July 22, 2023 21:42
Update a Flatcar installation on VMWare to use the latest OEM content
#!/usr/bin/env bash
# Update a Flatcar installation on VMWare to use the latest OEM content
#
# Copyright 2020, Neil Mayhew <neil@kerith.ca>
# LICENSE: MIT
set -ex
shopt -s extglob nullglob
#include "stdafx.h"
class PrivateClass{
private:
void SomeFunction() { printf("Hello World"); };
};
template <class Tag>
struct touch
@ndarville
ndarville / webm.md
Last active September 30, 2023 18:56
4chan’s guide to converting GIF to WebM - https://boards.4chan.org/g/res/41212767

Grab ffmpeg from https://www.ffmpeg.org/download.html

It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.

The most trivial operation would be converting gifs:

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
  • -crf values can go from 4 to 63. Lower values mean better quality.
  • -b:v is the maximum allowed bitrate. Higher means better quality.
std::vector<std::string>
sorted(std::vector<std::string> names)
{
std::sort(names);
return names;
}
// names is an lvalue; a copy is required so we don't modify names
std::vector<std::string> sorted_names1 = sorted( names );
@benoitbryon
benoitbryon / python_class_based_decorators.py
Last active December 14, 2015 23:49
Experiment class-based decorators for Python: do they help writing, testing and using decorators?
"""Class-based decorators.
This code was originally published as part of an article at
http://tech.novapost.fr/python-class-based-decorators-en.html
To run this file:
.. code-block:: sh
wget -O sample.py https://gist.github.com/benoitbryon/5168914/raw/
@aaronwolen
aaronwolen / slides.md
Last active November 11, 2022 23:57
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide

List

@kazupon
kazupon / Makefile
Created September 25, 2012 17:16
lua: native C-API coroutine sample
INCDIR = $(HOME)/opt/local/include/luajit-2.0
LIBDIR = $(HOME)/opt/local/lib
LIB = -lluajit-51
all: native
native:
cc --std=c99 -o native-co native.c -I$(INCDIR) -L$(LIBDIR) $(LIB) -pagezero_size 10000 -image_base 100000000
clean:
@cormacrelf
cormacrelf / gist:3760427
Created September 21, 2012 08:45
Pandoc Markdown -> latex with syntax highlighting
\documentclass[]{article}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifxetex
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\newcommand{\euro}{€}
\else
\ifluatex
\usepackage{fontspec}
@dfm
dfm / _chi2.c
Created August 3, 2012 13:41
How to wrap C code in Python
#include <Python.h>
#include <numpy/arrayobject.h>
#include "chi2.h"
/* Docstrings */
static char module_docstring[] =
"This module provides an interface for calculating chi-squared using C.";
static char chi2_docstring[] =
"Calculate the chi-squared of some data given a model.";