Skip to content

Instantly share code, notes, and snippets.

View buzzeins's full-sized avatar

buzzeins

View GitHub Profile

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.
@buzzeins
buzzeins / markdown.css
Created March 9, 2022 12:20 — forked from imjasonh/markdown.css
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@buzzeins
buzzeins / nginx_google_analytics
Created June 29, 2021 13:37 — forked from srstsavage/nginx_google_analytics
google analytics in nginx
# send logs for all traffic (including non-html) to google analytics
#
# in server block:
# set $google_analytics_id "UA-THECORRECT-ID";
# include /srv/nginx/google_analytics;
#
# in location blocks:
# post_action @ga;
#
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day.
<?
if ($params['parsemode'] == 'html') {
// config jevix
$this->jevix->cfgAllowTags(array('cut','a', 'img', 'div', 'span', 'i', 'b', 'u', 's', 'video', 'em', 'strong', 'nobr', 'li', 'ol', 'ul', 'sup', 'abbr', 'sub', 'acronym', 'h4', 'h5', 'h6', 'br', 'hr', 'pre', 'code', 'object', 'param', 'embed', 'blockquote', 'file'));
// $this->jevix->cfgSetTagShort(array('br','img', 'hr', 'cut', 'param'));
$this->jevix->cfgSetTagShort(array('br','img', 'hr', 'cut'));
$this->jevix->cfgSetTagPreformatted(array('pre','code','video'));
/**
* Simple localStorage with Cookie Fallback
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
* store('my_key');