Skip to content

Instantly share code, notes, and snippets.

@aheissenberger
aheissenberger / timemachine.sh
Last active September 30, 2023 10:19
Exclude package folder e.g. node_modules from being backuped by MacOS Time Machine
#!/bin/sh
#set -x
EXCLUDEFOLDERNAME=${3:-"node_modules"}
get_realpath ()
{
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
}
SEARCHPATH="$(get_realpath ${2:-"${HOME}"})"
@tschaub
tschaub / tools-as-depdendencies.md
Last active June 11, 2020 03:03
Reproducible module builds with tools (commands) as dependencies

Tools as dependencies

This example is a slight tweak on the best-practices example for working with Go modules as development dependencies.

The downside of the existing example is that someone who git clones your module to make a contribution, would not be able to run go generate (without extra work).

$ go generate
painkiller.go:5: running "stringer": exec: "stringer": executable file not found in $PATH
102650_300x300.jpg
105101_300x300.jpg
105819_300x300.jpg
106854_300x300.jpg
108064_300x300.jpg
109025_300x300.jpg
10951_300x300.jpg
109964_300x300.jpg
111227_300x300.jpg
111676_300x300.jpg
@mosquito
mosquito / README.md
Last active April 27, 2024 00:07
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@avih
avih / context.lua
Created February 2, 2017 14:07
flexible mpv context menu using Tcl/Tk, for Windows too!
--[[ *************************************************************
* Context menu for mpv using Tcl/Tk. Mostly proof of concept.
* Avi Halachmi (:avih) https://github.com/avih
*
* Features:
* - Simple construction: ["<some text>", "<mpv-command>"] is a complete menu item.
* - Possibly dynamic menu items and commands, disabled items, separators.
* - Possibly keeping the menu open after clicking an item (via re-launch).
* - Hacky pseudo sub menus. Really, this is an ugly hack.
* - Reasonably well behaved/integrated considering it's an external application.

Introduction

This table shows the current implementation status of several multimedia fomats by popular tools and browsers. All tests were run with the latest available version, or git HEAD for open source software.

Symbols mean

  • ✅ fully supported
  • ❗ unsupported
  • 💭 work in progress
  • 1️⃣️ see notes
#!/bin/bash
# Anh Nguyen <anh.ng8@gmail.com>
# 2016-04-30
# MIT License
# This script takes in same-size images from a folder and make a crossfade video from the images using ffmpeg.
# Make sure you have ffmpeg installed before running.
# The output command looks something like the below, but for as many images as you have in the folder.
@erincerys
erincerys / create-memtest-usb.sh
Created December 21, 2015 00:39
Prepare a USB flash drive with syslinux and memtest86+ for RAM testing
#!/bin/bash
# Install dependencies for creating filesystem and installing bootloader
## This script is mostly system-independent, except for this part. Replace yaourt and the args with your own package manager
yaourt -S --noconfirm mtools syslinux dosfstools
# Plug in the flash drive, and find its device. Don't mount it.
lsblk
while [[ $(echo $FLASHDEV | grep -c \/dev\/sd[a-z]) -lt 1 && -b "$FLASHDEV" ]] ; do
read -p 'Which device (e.g. /dev/sdf)? ' FLASHDEV
@deepak1556
deepak1556 / command.sh
Created October 30, 2015 09:27
Simple electron app to test pepper plugin load
#!/bin/bash
g++ ./hello.cc -shared -o libppapi_hello.so -I/home/robo/github/nacl_sdk/pepper_43/include -L/home/robo/github/nacl_sdk/pepper_43/lib/linux_host/Release -lppapi_cpp -lppapi -lpthread -Wall -fPIC
@skeeto
skeeto / jit.c
Last active September 27, 2023 11:27
Basic JIT
/* http://redd.it/2z68di */
#define _BSD_SOURCE // MAP_ANONYMOUS
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
#define PAGE_SIZE 4096