This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; | |
import { API_BASE_URL } from './apiConfig'; | |
/** | |
* ES6 Axios Class. | |
* | |
* @class Api | |
* @extends {Axios} | |
* @example | |
* class UserApi extends Api { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const pl = require('./package-lock.json'); | |
const p = require('./package.json'); | |
const plDeps = Object | |
.entries(pl.dependencies) | |
.reduce((deps, [dep, { version }]) => Object.assign(deps, { [dep]: version }), {}); | |
Object.entries(p.dependencies).forEach((dep) => { | |
const finalDep = plDeps[dep[0]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## change commits | |
####################################################### | |
git filter-repo --commit-callback ' | |
msg = commit.message.decode(\"utf-8\") | |
newmsg = msg.replace(\"old string\", \"new string\") | |
commit.message = newmsg.encode(\"utf-8\") | |
' --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# configure git log to show colored tree in one line with author and relative date | |
# refs: https://git-scm.com/docs/git-log | |
# http://git-scm.com/docs/pretty-formats | |
# http://willi.am/blog/2015/02/19/customize-your-git-log-format/ | |
git config --global --add alias.lol "log --graph --decorate --abbrev-commit --all --pretty=format:'%C(auto)%h%d%Creset %s %Cgreen%ad%Creset por %Cblue%cn%Creset' --date=relative" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Don't allow console.log() statements to be committed. | |
# Add to .git/hooks/pre-commit | |
YELLOW='\033[1;33m' | |
RED='\033[0;31m' | |
RESET='\033[0m' | |
# Don't allow console.log() statements to be committed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git --work-tree=/var/www/ghost --git-dir=/root/repository/ checkout -f | |
cd /var/www/ghost | |
chown -R ghost:ghost * | |
npm install --production | |
cd content/data | |
rm ghost.db | |
ln -s ghost-dev.db ghost.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SOURCE : http://xahlee.info/js/js_viewport_dimension.html | |
// CSS PIXELS: http://xahlee.info/js/web_design_screen_density.html | |
// user's physical screen dimension/size (Result is in physical pixels) | |
console.log( screen.width, screen.height ); | |
// user's window size (Result is in CSS pixels) | |
console.log( window.innerWidth, window.innerHeight ); | |
// viewport size (Result is in CSS pixels) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# posts a file named body.json to url | |
curl -H "Content-Type: application/json" --data-binary @body.json http://localhost:8080/ui/webapp/conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: | |
# http://stackoverflow.com/questions/7244321/how-to-update-github-forked-repository | |
# ============================================================================== | |
# Add the remote, call it "upstream": | |
git remote add upstream https://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches, | |
# such as upstream/master: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li><img width="495" height="370" title="" alt="css3" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgBcgHvAwERAAIRAQMRAf/EALQAAAMBAQADAQAAAAAAAAAAAAIDBAEABQYHCAEBAQEBAQEBAQAAAAAAAAAAAAECAwQFBgcQAAICAQIEBAEHCAYEDAYDAAABAgMRIQQxQRMFUWESBnGBkdHSkxQHoSIyklQVVRax8WKCoiPB4VKU8EJywjNzo8O0NUUIQ4MkRCVlJkYXEQEBAQACAQIFAgUCBgMAAAAAARECEgMhBFGRUhMFMRRBYbHRFSIy8HGh4fFCgSMG/9oADAMBAAIRAxEAPwD8xYMvotwRW4A7AV2AmO9I0xvpCtSyRWuIMd6AO9AGqBFx3oKmO6b8CpjPR5AEoEUXoIrukFY6is4HpGowx1cjbmzpLkgY7pFTHdIg7pBWdLyBjHSVMd0AmO6L5lMd0QY7okMd0GFx3QGrjegExvQBjuh5Ax3QBjeh5BMd93BjntyauB6Go0xnSCYzpeRV6s6WoMZ0sAxnTBgXWEwPTKmMdZUwPoCM9BRnoAz0hHekDseAGYAzBUdgDmkBmAjgMA8nhnme7G4IY3AaxvpBjvSDG+gGN9HAhglDHIauO9A1cF6BpjlAJglEK30Ab6BpjvRyCY3pgaqgrVAo70II7pmmLGOo1rGO6XkDHKoGN6XkVMZ0vIqY7o+QGqkLjuiExzoKY7oAd0CDeh5 |