Skip to content

Instantly share code, notes, and snippets.

@sangmank
sangmank / gist:044e77a07c5545f4e067a3ecdf3f336a
Created April 14, 2024 07:32
hacker news notification using pushover and haxor news
#!/usr/bin/env python3
# example crontab rule for notifying 400+ articles
# 7 7-22 * * 6-7 /home/user/bin/monitor_hn.py 400
import hashlib
import os
import re
import sys
import subprocess
#!/bin/bash
SUBDIRECTORY_OK=1
. $(git --exec-path)/git-sh-setup
cur_timestamp=$(date '+%s')
function remove_branch {
REF=$1
if [[ -z $2 ]]; then
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
# create our directories