const e = React.createElement;
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
// components/Tilt.js | |
import React, { useState, useEffect } from "react"; | |
import { motion } from "framer-motion"; | |
const Tilt = ({ children }) => { | |
const [mousePosition, setMousePosition] = useState({ x: window.innerWidth / 2, y: window.innerHeight / 2 }); | |
useEffect(() => { | |
const handleMouseMove = (e) => { | |
setMousePosition({ |
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
export default { | |
generate() { | |
var letters = "BCDEF"; | |
var color = "#"; | |
for (var i = 0; i < 6; i++) { | |
color += letters[Math.floor(Math.random() * letters.length)]; | |
} | |
return color; | |
}, | |
}; |
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
alias gits='git status' | |
alias gita='git add' | |
alias gitaa='git add .' | |
alias gitc='git commit -m' | |
alias gitl='git log' | |
alias gitb='git branch' | |
alias gitch='git checkout' | |
alias gitr='git reset HEAD^' | |
alias gitph='git push origin' | |
alias gitpl='git pull origin' |
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
Commits count by author: git shortlog -s -n --all --no-merges | |
All insertions and deletions by author: git log --shortstat --pretty="%cE" | sed 's/\(.*\)@.*/\1/' | grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' | sort | sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' | awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net";}' |
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
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt install php7.2-common php7.2-cli php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-mbstring php7.2-bcmath php7.2-imap php7.2-xml php7.2-zip | |
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer |
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
var message = 'a quick brown fox jumps over the lazy dog' | |
const splited = _.split(message, ' ') | |
var keywords = [] | |
_.forEach(splited, (item, index) => { | |
for(var i = 0; i < splited.length ; i++) { | |
var data = _.take(splited, i + 1) | |
data = _.join(data, ' ') | |
keywords.push(data) | |
console.log(data) |
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
sudo mongod --configsvr --replSet csr --dbpath data/db/ --port 27019 --logpath /var/log/mongodb/mongod.log --bind_ip 0.0.0.0 --fork | |
rs.initiate({ | |
_id: "csr", | |
configsvr: true, | |
members: [ | |
{ _id: 0, host : "10.128.0.44:27019"}, | |
{ _id: 1, host : "10.128.0.45:27019"}, | |
] | |
}) |
###Visual Studio Code
CMD+P
for search file in directory
NewerOlder