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
.pulse { | |
padding: 2px 5px; | |
display: inline-flex; | |
justify-content: center; | |
align-items: center; | |
border-radius: 8px; | |
cursor: pointer; | |
animation: pulse 3s infinite; | |
color: hsl(340, 86%, 43%); | |
} |
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
let variablesStyles: { [key: string]: HTMLStyleElement } = {}; | |
function updateCssStyle(id: string, styleString: string): void { | |
const newStyle = styleString; | |
if (!variablesStyles[id]) { | |
variablesStyles[id] = document.createElement('style'); | |
document.head.appendChild(variablesStyles[id]); | |
} |
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
const bcrypt = require('bcryptjs'); | |
const crypto = require('crypto'); | |
const http = require('http'); | |
const querystring = require('querystring'); | |
const { promisify } = require('util'); | |
const randomBytes = promisify(crypto.randomBytes); | |
const ONE_YEAR_IN_SEC = 365 * 24 * 60 * 60; | |
const users = []; |
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
const http = require('http'); | |
const colors = ['red', 'green', 'blue']; | |
function getUserType(user) { | |
// - long or cpu-intensive task - | |
switch (user.color) { | |
case 'red': | |
return 'red user'; |
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
function fish_prompt | |
set -l __last_command_exit_status $status | |
if not set -q -g __fish_yuriy_functions_defined | |
set -g __fish_yuriy_functions_defined | |
function _git_branch_name | |
set -l branch (git symbolic-ref --quiet HEAD ^/dev/null) | |
if set -q branch[1] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Understand Gun</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
#app { |
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
function getJSON(filename) { | |
if (!IS_PROD) { | |
getJSON.lastMtimes = getJSON.lastMtimes || {}; | |
const filePath = require.resolve(filename); | |
const { mtimeMs } = fs.statSync(filePath); | |
const lastMtime = getJSON.lastMtimes[filePath]; | |
if (!lastMtime || lastMtime !== mtimeMs) { | |
getJSON.lastMtimes[filePath] = mtimeMs; | |
delete require.cache[filePath]; |
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
#!/usr/bin/env bash | |
USERNAME="yuriy" | |
GROUP="wr" | |
CA_DIR="/etc/kubernetes/pki" | |
USER_CERTS_DIR="/home/$USERNAME/.certs" | |
mkdir -p $USER_CERTS_DIR | |
pushd $USER_CERTS_DIR |
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
// ==UserScript== | |
// @name Behance Grey Out Seen | |
// @version 1 | |
// @grant none | |
// @match https://www.behance.net/* | |
// ==/UserScript== | |
const ACTIVITY_RE = /\/(activity)?$/; | |
const PROJECT_RE = /\/gallery\/([0-9]+)\/.+/; | |
let viewedProjectIds = JSON.parse(localStorage.getItem('viewedProjectIds')) || []; |
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
/* eslint no-console: 0 */ | |
const { fork, spawn } = require('child_process'); | |
const web = fork(`${__dirname}/web.js`); | |
web.on('close', code => process.exit(code)); | |
if (process.env.NODE_ENV === 'development') { | |
const api = spawn('nodemon', ['--watch', 'server', '--ext', 'js,gql,json', 'server/api.js']); | |
api.stdout.on('data', data => process.stdout.write(data)); | |
api.stderr.on('data', data => process.stderr.write(data)); |
NewerOlder