Skip to content

Instantly share code, notes, and snippets.

View vascokk's full-sized avatar

Vassil "Vasco" Kolarov vascokk

View GitHub Profile
// The events are from https://www.w3.org/TR/html5/semantics-embedded-content.html#media-elements-event-summary
import videojs from 'video.js'
const Plugin = videojs.getPlugin('plugin')
const EVENTS = [
'loadstart',
'progress',
'suspend',
'abort',
'error',
@vascokk
vascokk / gist:13ec884144ad4099c1ecfa65993a6cf3
Last active March 26, 2022 13:37
Fix git object file .git/objects/..... is empty
# remove any empty object files
find .git/objects/ -type f -empty | xargs rm
# fetch down the missing objects
git fetch -p
# full object store check
git fsck --full
@vascokk
vascokk / bootstrapping-rust-freebsd-aarch64.md
Created February 19, 2022 12:59 — forked from dumbbell/bootstrapping-rust-freebsd-aarch64.md
Bootstrapping Rust and Cargo on FreeBSD/aarch64

Bootstrapping Rust and Cargo on FreeBSD/aarch64

At the time of this writing, Rust and Cargo are available on FreeBSD/amd64 and FreeBSD/i386 only, whether it is from rustup or from the FreeBSD ports tree. Here is how I could bootstrap Rust and Cargo for FreeBSD/aarch64 from FreeBSD/amd64.

Base system for the target

To be able to cross-compile anything, you need a userland for the target.

From a release

@vascokk
vascokk / instructions.md
Created January 23, 2022 16:24 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@vascokk
vascokk / gist:69e737cea0d89545629b6ac9e37098f7
Created August 31, 2021 09:47
Delete multiple GitHub repos
#!/bin/bash
repos="repo1 repo2 repo3"
user=<github username>
personal_token=<github personal auth token>
for repo in ${repos}; do
echo "Deleting! https://github.com/${user}/${repo}"
curl \
-X DELETE \
@vascokk
vascokk / deprecation.py
Created May 21, 2021 16:45
"deprecated" decorator in Python
import warnings
import functools
def deprecated(_func=None, *, replaced_with=None):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used."""
def decorator_deprecated(func):
@vascokk
vascokk / README.md
Created January 7, 2021 11:01 — forked from magnetikonline/README.md
AWS CloudFormation YAML template - appending to list parameter types.

AWS CloudFormation YAML template - appending to list parameter types

Documenting this here, as I often forget (what I have found) is the best way to do this at the moment.

For example, you have a list of two existing security groups given to a stack and wish to create (and use) a third - attaching all to an ALB:

AWSTemplateFormatVersion: "2010-09-09"
Description: "Example template"

Parameters:
@vascokk
vascokk / aws-lambda-relative-import-no-known-parent-package.md
Created December 6, 2020 18:20 — forked from gene1wood/aws-lambda-relative-import-no-known-parent-package.md
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
├── lambda_file.py
└── example.py
@vascokk
vascokk / doom.txt
Created June 28, 2020 10:51 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
sudo yum install -y systemtap systemtap-runtime
sudo yum install kernel-debuginfo kernel-debuginfo-common
sudo yum install yum-utils
debuginfo-install kernel-3.10.0-514.21.2.el7.x86_64
sudo yum install -y kernel-devel-$(uname -r)
sudo yum install -y kernel-debuginfo-$(uname -r)
sudo yum install -y kernel-debuginfo-common-$(uname -m)-$(uname -r)