Skip to content

Instantly share code, notes, and snippets.

View amsharifian's full-sized avatar

Amirali Sharifian amsharifian

View GitHub Profile
@amsharifian
amsharifian / TaskConcurrencyManifesto.md
Created November 29, 2020 06:52 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto
sudo apt update && sudo apt upgrade -y
[vim]
sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim -y
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
[python3.8]
sudo add-apt-repository ppa:deadsnakes/ppa
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Instll rls for mac:
rustup component add rls --toolchain stable-x86_64-apple-darwin
git clone https://github.com/rust-lang/rust.vim ~/.vim/pack/plugins/start/rust.vim
git clone --depth=1 https://github.com/racer-rust/vim-racer.git ~/.vim/bundle/vim-racer
@amsharifian
amsharifian / delete_git_submodule.md
Created February 4, 2020 21:36 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@amsharifian
amsharifian / gist:f1b50a46e5512b183e5db1d2daeaebd9
Created June 24, 2019 04:17 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@amsharifian
amsharifian / gist:e3493182ea535be96c7bb39d60c31c44
Created June 5, 2019 21:43 — forked from jagregory/gist:710671
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork [email protected]
### Keybase proof
I hereby claim:
* I am amsharifian on github.
* I am amsharifian (https://keybase.io/amsharifian) on keybase.
* I have a public key ASAM9Ph09U_FHJk-IRIo9zSp-yKThhLrPgbWYfARqKj3jAo
To claim this, I am signing this object:
#include <iostream>
#include <vector>
namespace std17
{
template<class InputIt, class T, class BinaryOp, class UnaryOp>
T transform_reduce(InputIt first ,
InputIt last ,
T init ,
BinaryOp binop ,
@amsharifian
amsharifian / fun.cpp
Created February 18, 2019 19:34 — forked from dant3/fun.cpp
Some fun with C++ 11 - fold, map, reduce, mkString for std::vector<T>
#include <iostream>
#include <sstream>
#include <functional>
#include <vector>
template <typename T, typename U>
U foldLeft(const std::vector<T>& data,
const U& initialValue,
const std::function<U(U,T)>& foldFn) {
typedef typename std::vector<T>::const_iterator Iterator;
pip install compdb
compdb -p build/ list > compile_commands.json