Skip to content

Instantly share code, notes, and snippets.

View ponchicken's full-sized avatar
🐣
Puk Puk Pukaaak

Alexander Balandin ponchicken

🐣
Puk Puk Pukaaak
View GitHub Profile
@ponchicken
ponchicken / debounce.js
Last active May 16, 2021 16:05
Helpers
const debounce = (fn, timing) => {
let timer
return function (...props) {
// immidiate
if (!timer) fn.call(this, ...props)
// recreate on every call to reset timer
clearTimeout(timer)
timer = setTimeout(() => {
PS1="\n \[\033[0;34m\]┌─────(\[\033[1;35m\]\u\[\033[0;34m\])─────(\[\033[1;32m\]\w\[\033[0;34m\]) \n └> \[\033[1;36m\]\$ \[\033[0m\]"
@ponchicken
ponchicken / .bashrc
Last active July 13, 2019 08:27
wsl docker
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin"
alias docker=docker.exe
alias docker-compose=docker-compose.exe
/* ==UserStyle==
@name slack grey
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author ponchicken
==/UserStyle== */
@-moz-document domain("slack.com") {
body,
@ponchicken
ponchicken / script.js
Created September 21, 2018 14:39
[smooth scrolling]
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
@ponchicken
ponchicken / .babelrc
Created August 24, 2018 09:34
Babelrc react
{
"presets": [
"env", "react"
],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
]
}
@ponchicken
ponchicken / logger.js
Created August 9, 2018 09:57
winston logger
const winston = require('winston')
const { combine, timestamp, json, colorize, printf } = winston.format
let date = new Date().toISOString();
const logFormat = printf(function(info) {
return `${info.level} - ${date}: ${info.message}\n`;
});
module.exports = {
@ponchicken
ponchicken / index.html
Last active September 20, 2018 14:07
[text reveal animation] animate text displaying by symbol #animation #text-effect
<div class="reveal">Some Things</div>
@ponchicken
ponchicken / steps.sh
Last active July 17, 2018 14:03
[clone to new repo] git clone to push into new repository #git #clone
git clone https://github.com/YOURREPO.git TargetRepoName
cd TargetRepoName/
git remote set-url origin https://github.com/TargetRepoName.git
git push -u origin master
@ponchicken
ponchicken / .env.development
Last active July 11, 2018 09:29
[react .env] env #react #env
BROWSER = none
PORT = 3004
REACT_APP_API_HOST = http://localhost:3000/api