Skip to content

Instantly share code, notes, and snippets.

View nazfox's full-sized avatar
🌸

彩桜なづな nazfox

🌸
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nazfox on github.
  • I am nazfox (https://keybase.io/nazfox) on keybase.
  • I have a public key ASDJ8dakEZoHxDHs32J3FFDT_8-bpPAC2Z04gPhV_3xDLQo

To claim this, I am signing this object:

import colorsys
import math
import random
import cairo
random.seed(10)
WIDTH = 500
HEIGHT = 500
#!/bin/bash
# --------------------------------------------------
# Generate help messages from Makefile
# --------------------------------------------------
#
# Example Makefile
#
# ```
# ## This is no displayed, this is just a comment
#/bin/sh
# Automatically generate .PHONY for Makefile
MAKEFILE=$1
cat $MAKEFILE | \
grep -E '^[a-zA-Z\-_0-9.]+:' | \
grep -Ev '^\.PHONY:' | \
grep -Ev '#.*NO_PHONY' | \
#!/bin/bash
command=$1
additional_message=$2
message="Can't find $command."
if [ -n "$additional_message" ]; then
message="$message $additional_message"
fi
INSTALL_STAMP = install.stamp
INSTALL_FILE = foo bar
install: $(INSTALL_STAMP)
$(INSTALL_STAMP): $(INSTALL_FILE)
# Install script
touch $(INSTALL_STAMP)
install-required-command: install
# Do things
@nazfox
nazfox / makefile-example
Created February 20, 2022 03:15
色々書いたけど使わなくなったので供養
##################################################
# GLOBALS
##################################################
LOG_DIR = ./log/
SCRIPT_DIR = ./src/scripts/
NOTEBOOK_DIR = ./notebooks/
FIND_COMMAND = $(SCRIPT_DIR)/find-command.sh
MAKEFILE_USAGE = $(SCRIPT_DIR)/makefile-usage.sh
@nazfox
nazfox / pipenv-and-python-invoke.sh
Last active February 20, 2022 09:52
Using the invoke task runner from a shell script. The command name displayed in the help message of invoke becomes this shellscript filename.
#!/usr/bin/bash
install_stamp=".install.stamp"
ver="0.1.0"
function find_command() {
type $1 > /dev/null 2>&1
}
function pipenv_error() {
#!/usr/bin/bash
#===========================================================
#
# This is a task runner.
# To learn how to use this, try running `./task help` first.
#
#===========================================================
import torch
from torch import nn
class BaseCouplingLayer(nn.Module):
def __init__(self, mask, m):
super().__init__()
self.mask = mask
self.m = m