Skip to content

Instantly share code, notes, and snippets.

View Enoch2090's full-sized avatar
⌨️
Alive

Yucheng Gu Enoch2090

⌨️
Alive
  • University of Michigan
  • Ann Arbor
  • 12:04 (UTC -04:00)
View GitHub Profile
@ShoufaChen
ShoufaChen / botnet.py
Last active September 26, 2023 08:57
PyTorch version Bottleneck Transformers
"""
A PyTorch version of `botnet`.
Original TensorFlow version: https://gist.github.com/aravindsrinivas/56359b79f0ce4449bcb04ab4b56a57a2
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
BATCH_NORM_DECAY = 1 - 0.9 # pytorch batch norm `momentum = 1 - counterpart` of tensorflow
@rudolfratusinski
rudolfratusinski / parallels_tools_ubuntu_new_kernel_fix.md
Last active November 23, 2022 20:01
Parallels Tools fix for Ubuntu 18.04 and other Linux distributions with Kernel version >= 4.15

Preparation

  • In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"

  • A "Parallels Tools" CD will popup on your Ubuntu desktop.

  • Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"

  • Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed)

  • Make command line installer executable (chmod +x install)

  • Change directory to "installer" (cd installer)

  • Make few other scripts executable: chmod +x installer.* *.sh prl_*

@steven2358
steven2358 / ffmpeg.md
Last active June 23, 2024 18:17
FFmpeg cheat sheet
@NoobsArePeople2
NoobsArePeople2 / gist:5121597
Last active November 10, 2023 14:33
Configure media keys on a non-Apple keyboard to control Spotify via AppleScript and USB Overdrive on OSX.

Requirements

  1. USB Overdrive
  2. A non-Apple keyboard with media keys (or keys you want to make "media" keys). For reference, I'm using a Microsoft Sidewinder X4

Set Up

  1. Plug in your keyboard and install USB Overdrive.
  2. Open USB Overdrive. Click into the Settings tab.
  3. Click the dropdown and select "Any Keyboard, Any Application"
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//