Skip to content

Instantly share code, notes, and snippets.

@jeasinema
jeasinema / weight_init.py
Last active May 25, 2023 09:32
A simple script for parameter initialization for PyTorch
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
def weight_init(m):
'''
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active May 13, 2024 01:55
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@samrocketman
samrocketman / KUbuntu_RAID0.md
Last active July 17, 2021 15:31
Configure KUbuntu 16.04 with RAID0

Notes for my system:

  • I couldn't get legacy boot to work. Only UEFI (using an EFI System Partition aka EPS).
  • The EPS can't be on the RAID0. You must allocate ~200 megabytes to the EPS.
  • KUbuntu installer was so buggy that I couldn't use it. Use Ubuntu to set up the system and then install kubuntu-desktop package.
  • When chrooting the EPS must be mounted on /boot/efi.
  • I recommend using Ubuntu 16.04 inside of virtualbox to create a startup boot disk on USB of Ubuntu 16.04 ISO. At first a tried using an earlier version of KUbuntu and it took a lot of trial/error to discover I shouldn't have done that.

Resources:

@zchee
zchee / actionlist.vim
Last active July 15, 2024 10:40
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@kodekracker
kodekracker / c++Template.cpp
Last active June 30, 2024 19:05
Basic C++ Template for Competitive Programming
/*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
* Example:- $ g++ -std=c++11 c++Template.cpp
*
* Author : Akshay Pratap Singh
* Handle: code_crack_01
*
*/
/******** All Required Header Files ********/