Skip to content

Instantly share code, notes, and snippets.

View yalu's full-sized avatar

yāλu yalu

  • Vajra Interactive
  • Kathmandu
View GitHub Profile
@ErikFontanel
ErikFontanel / filter-youtube-domains.sh
Last active February 18, 2025 09:33
Pi-hole Youtube ad blocking
#!/bin/sh
# This script will fetch the Googlevideo ad domains and append them to the Pi-hole block list.
# Run this script daily with a cron job (don't forget to chmod +x)
# More info here: https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253/136
# File to store the YT ad domains
FILE=/etc/pihole/youtube.hosts
# Fetch the list of domains, remove the ip's and save them
curl 'https://api.hackertarget.com/hostsearch/?q=googlevideo.com' \
@maacl
maacl / core.clj
Last active January 29, 2023 07:07
Domain Modelling using Clojure
(ns pms.core
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.test.alpha :as stest]))
(comment "This is a small experiment inspired by Oskar Wickströms
excellent work at
https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html. I
wanted to see what would be involved in building the equivalent
functionality in reasonably ideomatic Clojure. It is also my first
@bhb
bhb / README.md
Last active May 15, 2023 01:28
Clojure friendly mode, inspired by https://github.com/slipset/friendly
@mfikes
mfikes / cljs-main.md
Last active March 17, 2021 03:31
Command to get a preview of cljs.main

Usage

Start up the new cljs.main with Node:

clj -Sdeps '{:deps {org.clojurescript {:git/url "https://github.com/clojure/clojurescript" :sha "3f4084efcb5cd92cceb8ca30765144691d8cfd7e"}}}' -m cljs.main -re node

The above works by specifying ClojureScript as a "git dep" and you can ensure that you are running the very latest by replacing the :sha value with the latest commit SHA at https://github.com/clojure/clojurescript.

@bhb
bhb / blockchain-w-spec.md
Last active July 1, 2022 11:24
Building a blockchain, assisted by Clojure spec

Building a blockchain, assisted by Clojure spec

In an effort to gain at least a superficial understanding of the technical implementation of cryptocurrencies, I recently worked my way through "Learn Blockchains by Building One" using Clojure.

This was a good chance to experiment with using spec in new ways. At work, we primarily use spec to validate our global re-frame state and to validate data at system boundaries. For this project, I experimented with using instrumentation much more pervasively than I had done elsewhere.

This is not a guide to spec (there are already many excellent resources for this). Rather, it's an experience report exploring what went well, what is still missing, and quite a few unanswered questions for future research. If you have solutions for any of the problems I've presented, please let me know!

You don't need to know or care about blockchains to understand the code be

@dkozma
dkozma / inspect.clj
Last active August 13, 2017 22:38
Clojure->Chrome Inspector
(ns inspect
(:require [cheshire.core :refer [generate-string]]
[clojure.java.io :as io])
(:import (java.net Socket)
(def host "localhost")
(def port 9000)
(defn cinspect [data]
(with-open [sock (Socket. host port)
@pesterhazy
pesterhazy / re-natal-deep-clean.sh
Last active January 9, 2018 14:47
Re-natal: deep clean build artifacts
#!/usr/bin/env bash
set -euo pipefail && cd "$(dirname "${BASH_SOURCE[0]}")/.."
# When you're down and out
# When you're on the street
# When evening falls so hard, I will comfort you
# I will clean your build artifacts
# Disclaimer: use at your own risk
anonymous
anonymous / Untitled
Created May 31, 2017 17:45
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.11+commit.68ef5810.js&optimize=undefined&gist=
pragma solidity ^0.4.11;
contract BikramSamvat{
/*
* Unix timestamp to Bikram Samvat (Date Time Library)
* @NepalBitcoin
*/
address Bikram;
enum DaysInWeek{SUN,MON,TUE,WED,THU,FRI,SAT}
@swaldman
swaldman / Setting_Up_eth-netcompile_fedora_23.md
Last active August 18, 2019 22:30
eth-netcompile installation

Setting up ethnetcompile as a service under systemd Fedora 23

  1. Create user eth-netcompile with useradd
  2. sudo mkdir /usr/local/gitproject
  3. in /usr/local/gitproject, git clone [email protected]:swaldman/eth-netcompile.git
  4. in /usr/local/gitproject/eth-netcompile, /usr/local/pkg/node/bin/npm install --save to get dependencies
  5. Install the eth-netcompile.service file (also in this gist) in /usr/lib/systemd/system/
  6. Make a symlink from /etc/systemd/system/multi-user.target.wants/eth-netcompile.service to /usr/lib/systemd/system/eth-netcompile.service
  7. systemctl enable eth-netcompile.service followed by systemctl start eth-netcompile.service
  8. Verify that logging goes to the systemd journal with journalctl --follow -u eth-netcompile