made with esnextbin
This file contains 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
// https://egghead.io/courses/asynchronous-javascript-with-async-await | |
const fetch = require('node-fetch') | |
const fetchGitHubUser = async (handle) => { | |
const url = `https://api.github.com/users/${handle}` | |
const response = await fetch(url) | |
const body = await response.json() | |
if (response.status !== 200){ | |
throw Error(body.message) |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This file contains 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
<VirtualHost *:80> | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=308,L] | |
</VirtualHost> |
This file contains 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
git push origin --delete |
This file contains 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
Show hidden characters
{ | |
"presets": ["es2015"], | |
"plugins": [ | |
"add-module-exports" | |
] | |
} |
This file contains 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
// https://github.com/gigobyte/react-document-title-decorator/blob/master/example/setTitle.jsx | |
import React from 'react' | |
const setTitle = (getTitle) => (WrappedComponent) => { | |
return class extends React.Component { | |
updateTitle = (props) => { | |
const title = getTitle(props) | |
if(title) { | |
document.title = title | |
} |
This file contains 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
$(document).ready(function() { | |
$.validate(); | |
// Object as Array | |
$.fn.serializeObject = function() { | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; |
This file contains 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
wget -qO- https://deb.nodesource.com/setup_7.x | sudo bash - | |
sudo apt-get install -y nodejs | |
a2enmod rewrite |
This file contains 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
# Test it in docker | |
docker run -it --volume=/Users/AshikNesin/Code/sandbox/auto-deploy-pipelines:/auto-deploy-pipelines --workdir="/auto-deploy-pipelines" --memory=4g --entrypoint=/bin/bash node:7.0.0 |