Skip to content

Instantly share code, notes, and snippets.

@anthony-wang
anthony-wang / spotify-hosts.txt
Last active May 12, 2024 11:46
The hosts file entries to block Spotify ad servers
# Use this to block Spotify ad servers
# sources:
# https://www.reddit.com/r/Piracy/comments/4kn6rq/comprehensive_guide_to_blocking_ads_on_spotify/
# https://gist.github.com/teomaragakis/cb187d880c9a3ca2c8a2
# https://gist.github.com/Shujito/b7a8f8f971b22f49b4313d7d3e8e6931
# https://gist.github.com/rifkyekayama/f7c43e470f23878b20416e68f73829dc
# https://gist.github.com/shokoylele/8f4160a102480471cb946fbd800bc86a
############## Begin manual list
# 127.0.0.1 spclient.wg.spotify.com # might block the entire Spotify app from working too
@0xjac
0xjac / private_fork.md
Last active May 12, 2024 11:44
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@domoritz
domoritz / .block
Last active May 12, 2024 11:41
Vega Bl.ocks example
license: bsd-3-clause
@marcetcheverry
marcetcheverry / mapread.c
Created May 25, 2011 14:05
mmap and read/write string to file
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int argc, const char *argv[])
{
@spoo-bar
spoo-bar / cosmos-windows.md
Last active May 12, 2024 11:39
A guide to run a cosmos sdk based chain on Windows natively

Cosmos on Windows

By the end of this guide, you will be running a Cosmos chain on your local machine. We will start with the assumption that you are on a clean fresh new Windows10/11 system.

We will be using Powershell as our terminal and not Command Prompt. I highly recommend you install Windows Terminal app. You can download it here from the Windows Store

❗This guide has not yet been tested with chains which use x/wasmd (Cosmwasm).

There are two ways to get Cosmos chains running on Windows.

@cpq
cpq / Mutex.md
Last active May 12, 2024 11:31
What is a mutex and how does it work

What is a mutex and how does it work

Imagine a big office (your program), with many assets (shared resources) and many employees (threads). For example, all employees share one common resource - a toilet. They have agreed to use a label on a toilet's door (mutex).

When an employee wants to use the toilet he checks a label on a door (locks a mutex). If it is "engaged" he waits (blocks on a mutex), then when it is "free", he enters the toilet and changes the label to

@eerien
eerien / forms.py
Last active May 12, 2024 11:20
Comma Separated Values Form Field for Django. There are CommaSeparatedCharField, CommaSeparatedIntegerField.
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
class MinLengthValidator(validators.MinLengthValidator):
message = 'Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).'
class MaxLengthValidator(validators.MaxLengthValidator):
message = 'Ensure this value has at most %(limit_value)d elements (it has %(show_value)d).'
@JosefJezek
JosefJezek / how-to-use-pelican.md
Last active May 12, 2024 11:19
How to use Pelican on GitHub Pages
@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active May 12, 2024 11:18
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.

Requisites