Skip to content

Instantly share code, notes, and snippets.

Mohammad Nasirifar farnasirim

Block or report user

Report or block farnasirim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@farnasirim
farnasirim / ternary_on_integer_domain.cpp
Created Aug 21, 2018
Ternary search on integer domain + test drive
View ternary_on_integer_domain.cpp
#include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
using namespace std;
template <typename Compare>
int findMax(int from, int to, Compare lessFunctor) { // from and to are inclusive: [from, to]
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:800px; -webkit-transform:rotate(0deg)">
<scene width="600" id="scene1">
<label t="translate(0,346)">
@farnasirim
farnasirim / .vimrc
Created Dec 16, 2017
Poor man's .vimrc
View .vimrc
set ts=4
set sw=4
set smartindent
set ai
set background=dark
colorscheme slate
syntax enable
set nocompatible
filetype plugin indent on
set hlsearch
@farnasirim
farnasirim / goto.sh
Last active Nov 2, 2017
navigate to a go project directory easily using `goto` command
View goto.sh
#!/bin/bash
if [ -z "$@" ]; then
echo "Usage: goto project-name"
return
fi
search_path=$GOPATH/src/
for i in {1..3}; do
You can’t perform that action at this time.