Skip to content

Instantly share code, notes, and snippets.

View HaoZeke's full-sized avatar
:octocat:
Gasping for air.

Rohit Goswami HaoZeke

:octocat:
Gasping for air.
View GitHub Profile
---
title: "Coloring stuff!"
author: "Andrew Heiss"
date: "`r Sys.Date()`"
output:
xaringan::moon_reader:
lib_dir: "libs"
seal: false # No title slide
nature:
highlightStyle: github
@chriselsner
chriselsner / nix-on-macos-catalina.md
Last active September 19, 2024 00:46
Nix on macOS Catalina

Nix on macOS Catalina

I'm writing this gist for my own records but it might help someone else too.

Installing Nix

Support for Catalina has improved a lot since the update was first rolled out.

Note: See the NixOS manual for discussion of the --darwin-use-unencrypted-nix-store-volume option.

# Now available here: https://github.com/y0ast/pytorch-snippets/tree/main/minimal_cifar
@5shekel
5shekel / export-ble-infos.py
Last active July 28, 2024 14:35 — forked from Mygod/export-ble-infos.py
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Export your Windows Bluetooth LE keys into Linux! (arch edition)
Thanks to: http://console.systems/2014/09/how-to-pair-low-energy-le-bluetooth.html
discussed here: https://unix.stackexchange.com/questions/402488/dual-boot-bluetooth-device-pairing
Usage:
$ ./export-ble-infos.py <args>
$ sudo bash -c 'cp -r ./bluetooth /var/lib'
@jefflombard
jefflombard / ag_replace.sh
Last active October 12, 2021 13:36
agr command - Find and Replace with ag on Mac OSX
#!/bin/sh
agr () {
# find and replace
regex=s/${1}/${2}/g;
ag $1 -l | xargs sed -i.agr_backup $regex;
# delete backups
ag -G .agr_backup -l | xargs rm
}

PyTorch IR

This document presents the IR as of October 17th 2018. Future changes like mutability might render parts of this document outdated.

PyTorch uses an SSA-based IR, which is built of multiple entities:

  • Graph is generally the outermost container for the program representation. At the moment all programs are mostly pure (modulo special operators like prim::Print or prim::PythonOp), but this will change in the future.
  • Then, there are Blocks, which you can treat as functions. They have a list of inputs and outputs, and a (topologically ordered) list of Nodes. Every Graph has a top-level Block which is (using C lingo) like a main function.
  • Nodes, in turn, represent calls to functions (with possibly multiple arguments and returns).
  • Finally, every single intermediate value that appears in the program is represented using a Value - the root Blocks have a list of input values, and every Node takes them as inputs, and returns some more as outputs. Every Value has a Type a
@nadavrot
nadavrot / Matrix.md
Last active April 20, 2025 12:59
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@areinisc
areinisc / README.md
Last active September 3, 2018 13:20
PHOTOMETRY --- doom-emacs -- automatic theme adjustment based on ambient light

Adding automatic light/dark theme switching to doom-emacs running on a mac with ambient light sensor.

Idea adapted from: Matt Bilyeu https://matthewbilyeu.com/blog/2018-04-09/setting-emacs-theme-based-on-ambient-light

Installation

  1. Make the lmutracker executable using clang and place it in your custom doom directory:
    $ cd ~/.doom.d/    # start in your custom doom directory, wherever that is for you.
    

$ touch lmutracker.mm # copy in the contents of this file however you like

@eddiewebb
eddiewebb / readme.md
Last active May 12, 2025 09:35
Hugo JS Searching with Fuse.js
@jaredmales
jaredmales / rclone-cron.sh
Last active February 20, 2025 08:08
An rclone backup script for cron
#!/bin/bash
##############################################################################
# An rclone backup script by Jared Males ([email protected])
#
# Copyright (C) 2018 Jared Males <[email protected]>
#
# This script is licensed under the terms of the MIT license.
# https://opensource.org/licenses/MIT
#