Skip to content

Instantly share code, notes, and snippets.

View zahin-mohammad's full-sized avatar

Zahin Mohammad zahin-mohammad

  • Toronto
View GitHub Profile
@jzxhuang
jzxhuang / ecelinux.md
Last active March 31, 2024 01:30
ECE Linux SSH + VS Code Configuration

ECE Linux SSH + VS Code Setup Guide

How to set up SSH for ECE linux "the right way". No VPN is required to SSH into ECE linux. Notably, with this setup:

  • Skip eceterm completely and go directly to eceubuntu/ecetesla - you only need to type the SSH command ONCE (and enter your password ONCE).
  • Configure VS Code to work over SSH. Edit remote files while maintaining your VS Code features like Intellisense, syntax highlighting, themes, etc.

Skip to the bottom of the document for a summary (TL;DR).

Disclaimer: I have only tested on macOS. It should work fine for *nix systems, but not sure about Windows. The instructions are up-to-date as of the last update of the Gist. Some Windows-specific notes are included in some sections thanks to feedback from classmates using Windows.

@metafeather
metafeather / main.go
Created April 27, 2017 13:06
Get goroutine id for debugging
# ref: https://play.golang.org/p/OeEmT_CXyO
package main
import (
"fmt"
"runtime"
"strconv"
"strings"
"sync"
)
@VojtechVitek
VojtechVitek / slice-batch-in-parallel.go
Last active December 25, 2023 09:42
Golang - Loop over slice in batches (run something in parallel on a sub-slice)
package main
import "fmt"
func main() {
slice := make([]int, 159)
// Split the slice into batches of 20 items.
batch := 20
@jeanbza
jeanbza / CoreferenceResolver.java
Last active January 19, 2021 21:38
pronoun replacement
/*
Make sure you have the following in your `build.gradle`:
'edu.stanford.nlp:stanford-corenlp:3.7.0',
'edu.stanford.nlp:stanford-corenlp:3.7.0:models@jar',
'edu.stanford.nlp:stanford-corenlp:3.7.0:models-english@jar',
*/
package com.knowledge.coreferenceResolution;
@frfahim
frfahim / install virtualenv ubuntu 16.04.md
Last active May 20, 2024 06:45
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@typoerr
typoerr / set.ts
Last active June 16, 2023 16:37
Typesafe immutable set with lodash/fp/set
/* tslint:disable:max-line-length */
const _ = {
set: require('lodash/fp/set'),
};
function set<O, K1 extends keyof O, K2 extends keyof O[K1], K3 extends keyof O[K1][K2], K4 extends keyof O[K1][K2][K3], K5 extends keyof O[K1][K2][K3][K4], K6 extends keyof O[K1][K2][K3][K4][K5], K7 extends keyof O[K1][K2][K3][K4][K5][K6], K8 extends keyof O[K1][K2][K3][K4][K5][K6][K7], K9 extends keyof O[K1][K2][K3][K4][K5][K6][K7][K8], K10 extends keyof O[K1][K2][K3][K4][K5][K6][K7][K8][K9], V>(obj: O, path: string | [K1, K2, K3, K4, K5, K6, K7, K8, K9, K10], val: V): O & Record<K1, Record<K2, Record<K3, Record<K4, Record<K5, Record<K6, Record<K7, Record<K8, Record<K9, Record<K10, V>>>>>>>>>>;
function set<O, K1 extends keyof O, K2 extends keyof O[K1], K3 extends keyof O[K1][K2], K4 extends keyof O[K1][K2][K3], K5 extends keyof O[K1][K2][K3][K4], K6 extends keyof O[K1][K2][K3][K4][K5], K7 extends keyof O[K1][K2][K3][K4][K5][K6], K8 extends keyof O[K1][K2][K3][K4][K5][K6][K7], K9 extends keyof O[K1][K2][K3][K4][K5][K6][K7
@byrnedo
byrnedo / ComputeHmac256.go
Created September 12, 2016 07:32
Compute a hmac for a message in golang
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
@squarism
squarism / iterm2.md
Last active June 16, 2024 12:26
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 17, 2024 09:56
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@hofmannsven
hofmannsven / README.md
Last active June 17, 2024 10:34
Git CLI Cheatsheet