Skip to content

Instantly share code, notes, and snippets.

View LifeIsStrange's full-sized avatar
🎯
Focusing

LifeIsStrange

🎯
Focusing
View GitHub Profile
@armsp
armsp / voice.py
Last active April 3, 2023 17:47
Identifying sentences with passive voices (english) using Spacy
import spacy
from spacy.matcher import Matcher
Active = "Harry ate six shrimp at dinner.\
Beautiful giraffes roam the savannah.\
Sue changed the flat tire.\
We are going to watch a movie tonight.\
I ran the obstacle course in record time.\
The crew paved the entire stretch of highway.\
Mom read the novel in one day.\
@nadavrot
nadavrot / Matrix.md
Last active April 20, 2025 12:59
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@abhijeet2096
abhijeet2096 / bst.pl
Created April 1, 2018 05:41
Binary Search Tree Implementation in Prolog
%% Topic : Binary Search Tree Implementation in Prolog
%% Author : Abhijeet Sharma | Akhil Singhal
%% Date : 26/03/2018
%% Course : Paradigms of Programming
%% Sample Inputs
%% Input inl([3,6,1,2,4,7,9],nil,X).
%% X = t(3, t(1, nil, t(2, nil, nil)), t(6, t(4, nil, nil), t(7, nil, t(9, nil, nil))))
@rexlow
rexlow / install.sh
Last active March 23, 2023 09:26
Enable zsh in Gcloud shell
##
# This is an adoption from Oh My Zsh for Google Cloud Shell
# author - bobvanluijt
# source - https://github.com/bobvanluijt/google-cloud-shell-pro-zsh
##
main() {
# Install zsh
sudo apt-get -qq update
@kunalkushwaha
kunalkushwaha / runtime-benchmark.md
Last active February 7, 2024 01:17
Runtime performance benchmark result. [containerd vs CRI-containerd vs CRI-O]

Software Versions

$ runc --version
runc version 1.0.0-rc4+dev
commit: f53ad9cec928821a25c2a74eb8bd95558f8cf152-dirty
spec: 1.0.0

$ containerd --version
containerd github.com/containerd/containerd v1.0.0-beta.3-86-g9649a42 9649a428e8c470cddc0d5a3c394f36111f940adc

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@AdelDima
AdelDima / .zshrc
Last active August 8, 2022 00:20
Cygwin & oh-my-zsh
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
@elizarov
elizarov / MultiShotEnumeration.kt
Created May 3, 2017 09:01
Showcase for Kotlin multishot continuations
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
fun main(args: Array<String>) {
enumerate {
if (flip("A")) {
if (flip("B")) 1 else 2
} else {
if (flip("C")) 3 else if (flip("D")) 4 else 5
}
@nicowilliams
nicowilliams / fork-is-evil-vfork-is-good-afork-would-be-better.md
Last active March 14, 2025 02:50
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid

I recently happened upon a very interesting implementation of popen() (different API, same idea) called popen-noshell using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

This is not a paper. I assume reader familiarity with fork() in particular and Unix in general, though, of course, I link to relevant wiki pages, so if the unfamiliar reader is willing to go down the rabbit hole, they should be able to come ou

@wumpz
wumpz / gist:5846559
Created June 23, 2013 21:12
list authors of a git repository including commit count and email
git shortlog -e -s -n