Skip to content

Instantly share code, notes, and snippets.

@hallettj
hallettj / 1. xmodmap .f90
Last active May 7, 2024 03:04
I inverted the number row on my keyboard - meaning that pressing the keys produces symbols by default, and I type numbers by holding shift. As a programmer I use symbols frequently, so I think that this will be advantageous. Here are the details of my configuration.
!
! Invert number row
!
! This changes the behavior of keys in the number row, but does not
! affect the number pad.
!
keycode 10 = exclam 1 1 exclam
keycode 11 = at 2 2 at
keycode 12 = numbersign 3 3 numbersign
keycode 13 = dollar 4 4 dollar
@ara-ta3
ara-ta3 / main.go
Created August 31, 2017 10:11
How to bind to struct with join query in sqlx
package main
import (
"fmt"
_ "github.com/go-sql-driver/mysql"
"github.com/jmoiron/sqlx"
)
type Hoge struct {
@elowy01
elowy01 / BCFtools cheat sheet
Last active May 7, 2024 02:55
BCFtools cheat sheet
*bcftools filter
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2)
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz
*printing out info for only 2 samples:
bcftools view -s NA20818,NA20819 filename.vcf.gz
*printing stats only for variants passing the filter:
bcftools view -f PASS filename.vcf.gz
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 7, 2024 02:55
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@pich4ya
pich4ya / openssl3_no_md4.txt
Last active May 7, 2024 02:53
Fix evil-winrm error on macOS M1: "Error: An error of type OpenSSL::Digest::DigestError happened, message is Digest initialization failed: initialization error"
# @author Pichaya Morimoto (p.morimoto@sth.sh)
# gem install evil-winrm
# evil-winrm -u "${user}" -p "${pass}" -i "${ip}"
Evil-WinRM shell v3.4
Info: Establishing connection to remote endpoint
Error: An error of type OpenSSL::Digest::DigestError happened, message is Digest initialization failed: initialization error
AWSTemplateFormatVersion: 2010-09-09
Description: Template which deploys a basic VPC with a single SG, 2 public subnets and an IGW. Optionally can also deploy 2 private subnets and a NAT gateway
Parameters:
Subnet1AzParameter:
Type: AWS::EC2::AvailabilityZone::Name
Description: First subnet avalibility zone
Subnet2AzParameter:
Type: AWS::EC2::AvailabilityZone::Name
Description: Second subnet avalibility zone
# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 7, 2024 02:45
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Decencies
Decencies / jnic-3.5.1-evaluator.c
Created February 6, 2023 00:56
JNIC 3.5.1 Sim0n/Evaluator output
This file has been truncated, but you can view the full file.
/*
* Auto-generated JNIC implementation file
*
*
*
*
*
*
*/