Skip to content

Instantly share code, notes, and snippets.

View SerkanSipahi's full-sized avatar
🎯
Focusing

Bitcollage SerkanSipahi

🎯
Focusing
View GitHub Profile
@SerkanSipahi
SerkanSipahi / gist:10d4249910f35aee6f86184201d3eeaa
Last active January 16, 2023 09:15
multiple git accounts
# global
Host *
AddKeysToAgent yes
UseKeyChain yes
IdentityFile ~/.ssh/id_rsa_home
ForwardAgent yes
# GitHub home
# Example usage: git clone git@id_rsa_home:myPrivateGitName/example.git
# Usage:
@SerkanSipahi
SerkanSipahi / iterm2-solarized.md
Created October 28, 2022 07:32 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

"" Source your .vimrc
"source ~/.vimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
@SerkanSipahi
SerkanSipahi / mato.js
Last active January 6, 2022 13:13
matomo for agnostic spa apps
let currentUrl = location.href;
document.addEventListener('DOMContentLoaded', function(){
let previousUrl = '';
const observer = new MutationObserver(function(mutations) {
if (location.href === previousUrl) return;
_paq.push(['setReferrerUrl', currentUrl]);
currentUrl = '/' + location.pathname + location.search;
_paq.push(['setCustomUrl', currentUrl]);
@SerkanSipahi
SerkanSipahi / rxjs-draggable.js
Last active September 10, 2018 08:09
draggable div element with rxjs v6.3.2
let draggableEl = document.querySelector('.draggable');
let mouseup$ = fromEvent(document, 'mouseup');
let mousemove$ = fromEvent(document, 'mousemove');
let mousedown$ = fromEvent(draggableEl, 'mousedown');
let mousedrag$ = mousedown$.pipe(
mergeMap(({offsetX, offsetY}) =>
mousemove$.pipe(
map(({clientX, clientY}) => ({
@SerkanSipahi
SerkanSipahi / .eslintrc.js
Created December 26, 2015 20:21 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
00000000 63 75 72 6c 20 2d 58 20 50 55 54 20 68 74 74 70 |curl -X PUT http|
00000010 3a 2f 2f 6c 6f 63 61 6c 68 6f 73 74 3a 35 39 38 |://localhost:598|
00000020 34 2f 5f 75 73 65 72 73 2f 6f 72 67 2e 63 6f 75 |4/_users/org.cou|
00000030 63 68 64 62 2e 75 73 65 72 3a 66 6f 6f 20 2d 48 |chdb.user:foo -H|
00000040 20 22 41 63 63 65 70 74 3a 20 61 70 70 6c 69 63 | "Accept: applic|
00000050 61 74 69 6f 6e 2f 6a 73 6f 6e 22 20 2d 48 20 22 |ation/json" -H "|
00000060 43 6f 6e 74 65 6e 74 2d 54 79 70 65 20 61 70 70 |Content-Type app|
00000070 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e 22 20 2d |lication/json" -|
00000080 48 20 22 49 66 2d 4d 61 74 63 68 3a 20 33 2d 63 |H "If-Match: 3-c|
00000090 39 38 39 63 61 66 65 62 32 63 31 61 34 37 61 32 |989cafeb2c1a47a2|
@SerkanSipahi
SerkanSipahi / gist:f89bccd350d410de5b8a3def2a7043a2
Created October 7, 2017 15:41
couch 2.1 crash on el-capitan
last msg: {'EXIT',<0.4251.0>,{{badmatch,{error,enoent}},[{couch_compaction_daemon,abs_path,1,[{file,"src/couch_compaction_daemon.erl"},{line,526}]},{couch_compaction_daemon,free_space_rec,2,[{file,"src/couch_compaction_daemon.erl"},{line,517}]},{couch_compaction_daemon,can_db_compact,2,[{file,"src/couch_compaction_daemon.erl"},{line,327}]},{couch_compaction_daemon,maybe_compact_db,3,[{file,"src/couch_compaction_daemon.erl"},{line,164}]},{couch_compaction_daemon,'-compact_loop/1-fun-0-',3,[{file,"src/couch_compaction_daemon.erl"},{line,141}]},{couch_server,'-all_databases/2-fun-0-',4,[{file,"src/couch_server.erl"},{line,273}]},{filelib,do_fold_files2,8,[{file,"filelib.erl"},{line,184}]},{filelib,do_fold_files2,8,[{file,"filelib.erl"},{line,194}]}]}}
state: {state,<0.4251.0>,[]}
[error] 2017-10-07T15:05:56.705451Z couchdb@localhost <0.4249.0> -------- CRASH REPORT Process couch_compaction_daemon (<0.4249.0>) with 0 neighbors exited with reason: {compaction_loop_died,{{badmatch,{error,enoent}},[{couch_com
// #########################################
// rest/get.go
// #########################################
// This is working but its not what i want.
func GET(c echo.Context) error {
// do something
}
// This is not working.
@SerkanSipahi
SerkanSipahi / promises.md
Created May 25, 2016 20:32 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.