Skip to content

Instantly share code, notes, and snippets.

View Youhan's full-sized avatar
😊

Alireza Jahandideh Youhan

😊
View GitHub Profile
<!-- A/B testable -->
<rec-search-form class="ab-original-searchbar hidden md:flex items-center mr-2 md:mr-4 w-full" search-url="{{ routes.search_url }}" aria-label="Search form"></rec-search-form>
<rec-algolia-autocomplete class="ab-algolia-searchbar search-bar" placeholde="test" search-url="{{ routes.search_url }}" aria-label="Search form"></rec-algolia-autocomplete>

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@Youhan
Youhan / forecasting_metrics.py
Created March 14, 2020 03:44 — forked from bshishov/forecasting_metrics.py
Python Numpy functions for most common forecasting metrics
import numpy as np
EPSILON = 1e-10
def _error(actual: np.ndarray, predicted: np.ndarray):
""" Simple error """
return actual - predicted
@Youhan
Youhan / iterm2.md
Created August 4, 2019 01:07 — forked from squarism/iterm2.md
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)
@Youhan
Youhan / functions.php
Created February 21, 2018 10:05
override portfolio nav - toranj wp
/**
* ----------------------------------------------------------------------------------------
* Override portfolio nav
* ----------------------------------------------------------------------------------------
*/
function owlab_portfolio_single_nav() {
$next = get_next_post();
$prev = get_previous_post();
@Youhan
Youhan / functions.php
Last active May 24, 2017 09:03
Update vc_icon and add your own to the list
// 1- update map for vc_icons
add_action( 'vc_after_init', 'hubble_vc_icon_settings' );
function hubble_vc_icon_settings() {
if ( ! WPBMap::exists('vc_icon') )
return false;
$vc_icon_map = WPBMap::getShortCode('vc_icon');
//$params = $vc_icon_map['params'];
@Youhan
Youhan / gist:dab8f22addb2ae0dbe90c4e2c5442112
Created April 26, 2017 07:33
Toranj Custom js / Masterslider fraction
var msSlider={
//This is the function that controlls all masterslider instances or atleast it tries to do!
init:function($target){
var self=this;
//Select the target which can be passed to the function or auto selected from DOM
var $elem=$target || $('.tj-ms-slider');
@Youhan
Youhan / composer.json
Created May 27, 2016 03:31 — forked from 256cats/composer.json
Web scraping ReactPHP Curl Proxies, curl multi example, scraping news ycombinator, explanation here: http://256cats.com/fast-scraping-with-reactphp-curl-proxies/
{
"require": {
"khr/react-curl": "~2.0",
"sunra/php-simple-html-dom-parser": "~1.5"
}
}
@Youhan
Youhan / 0_reuse_code.js
Created April 25, 2016 10:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php if ( is_front_page() ):?>
<div class="my-custom-logo">
<a href="http://www.future-archs.com/" title="Future Arch's">
<img src="http://www.future-archs.com/FutureL6.png" alt="Future Arch's">
</a>
</div>
<?php endif;?>