Skip to content

Instantly share code, notes, and snippets.

View aminya's full-sized avatar
🤖

Amin Yahyaabadi aminya

🤖
View GitHub Profile
@pfitzseb
pfitzseb / keyboardmacro.jl
Created June 16, 2019 07:46
keyboard macro prototype
using REPL
using REPL.LineEdit
macro keyboard()
quote
debugprompt(@__MODULE__, Base.@locals)
println()
end
end
# some definitions:
immutable NArgsOut{N}
NArgsOut() = ((isa(N,Int) && N>=-1) || error("nargsout must be ≥ -1"); new())
end
nargsout(N::Integer) = NArgsOut{int(N)}()
# null behavior example:
f(::NArgsOut{-1}) = f() # -1 is a sentinal value and should have no effect on the output
using PyCall
using LinearAlgebra
using Statistics
using StatsBase
using BenchmarkTools
using Distances
# import the same data
data = pyimport("sklearn.datasets")
using Base.Threads
using LoopVectorization
using BenchmarkTools
const None = [CartesianIndex()]
function distances(data1, data2)
data1 = deg2rad.(data1)
data2 = deg2rad.(data2)
lat1 = @view data1[:, 1]
@devlifeX
devlifeX / .bashrc
Last active December 25, 2020 15:50
Append These code to your .bashrc and make your life easier!
# Docker section ################################################
# - Stop all running docker containers
function stopAll {
containers=$(docker ps -qa)
if [ ! -z "$containers" ]
then
echo $containers | xargs docker container rm -f $1
else
echo "No Containers for remove!" | grep -e "."
@UziTech
UziTech / .gitconfig
Last active March 16, 2021 15:42
git aliases
[alias]
# rebase current branch with remote branch
# git up [remote=upstream] [branch=master]
up = !"f() {\
if [ $# -lt 1 ];\
then remote=upstream;\
else remote=$1;\
fi;\
if [ $# -lt 2 ];\
then repo=master;\
@weihanglo
weihanglo / how-is-new-terminal-in-vs-code-so-fast.md
Last active October 27, 2021 02:18
How Is New Terminal In VS Code So Fast?

Last week, a new version (1.17) of Visual Studio Code was released. While there are many fascinating improvements and features introduced, the one that cought my eyes is "Integrated Terminal performance" section. Let's check out what they've done!

(written on 2017-10-12, based on Xterm.js v3, VS Code 1.17)

Old Performance Issue

@lski
lski / wslpath.ps1
Created April 6, 2019 13:25
wslpath wrapper for using directly in powershell
<#
.SYNOPSIS
Converts windows path into a linux path and vice versa.
.DESCRIPTION
Converts windows path into a linux path and vice versa. Use WSL under the hood, so needs to be installed.
See docs wslpath docs for more information.
.PARAMETER path
The path to convert
@addyosmani
addyosmani / bytecode.md
Last active May 28, 2022 22:40
Thoughts on precompiling JS bytecode for delivery through a server/CDN

Some quick thoughts on https://twitter.com/dan_abramov/status/884892244817346560. It's not ignorant at all to ask how browser vendors approach performance. On the V8 side we've discussed bytecode precompilation challenges a few times this year. Here's my recollection of where we stand on the idea:

JavaScript engines like V8 have to work on multiple architectures. Every version of V8 is different. The architectures we target are different. A precompiled bytecode solution would require a system (e.g the server or a CDN) to generate bytecode builds for every target architecture, every version of V8 supported and every version of the JavaScript libraries or bundles bytecode is being generated for. This is because we would need to make sure every user accessing a page using that bytecode can still get the final JS successfully executed.

Consider that if a cross-browser solution to this problem was desired, the above would need to be applied to JavaScriptCore, SpiderMonkey and Chakra as well. It would need to ca

@stigok
stigok / atom-commands.md
Last active September 7, 2022 01:47
List of key bindable Atom commands

Atom Commands

Application

application:about
application:show-preferences
application:show-settings
application:quit
application:hide

application:hide-other-applications