Skip to content

Instantly share code, notes, and snippets.

View Muskos's full-sized avatar
🐼
~

Aleksey Makas Muskos

🐼
~
  • Poland, Warsaw
View GitHub Profile
@Muskos
Muskos / gist:3e8928ef5778dd3ddb0d85b7d7ffb416
Created September 14, 2019 16:26
oh my zsh theme extend bira.zsh-theme
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m %{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m %{$reset_color%}'
local user_symbol='$'
fi
import
{ [Function: model]
hooks:
Kareem {
_pres: Map { 'save' => [Array], 'remove' => [Array] },
_posts: Map { 'save' => [Array], 'init' => [Array] } },
base:
Mongoose {
connections: [ [NativeConnection] ],
models: { User: [Circular] },
@Muskos
Muskos / VSCodePluging.txt
Created April 26, 2018 19:24
List of plugin for VS Code
Import Cost
Auto Close Tag
Auto Rename Tag
TODO highlight
ES7 React
GitLens
ESLint
@Muskos
Muskos / ajax-request.js
Last active November 27, 2018 12:06
Wrapper under XMLHttpRequest for simple request with Promise
export default (url, method = 'POST', params) => {
return new Promise((resolve, reject) => {
const request = new XMLHttpRequest();
request.open(method, url, true);
request.setRequestHeader("X-Requested-With", "XMLHttpRequest");
request.onload = () => {
if (request.status >= 200 && request.status < 400) {
try{
resolve(JSON.parse(request.responseText));