Skip to content

Instantly share code, notes, and snippets.

View yarkovaleksei's full-sized avatar
🏠
Working from home

Yarkov Aleksey yarkovaleksei

🏠
Working from home
  • Russia, Rostov-on-Don
View GitHub Profile
[].forEach.call($$("*"),(a)=>{a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
@yarkovaleksei
yarkovaleksei / event-listeners.js
Created April 17, 2017 21:44 — forked from danburzo/README.md
Get all event listeners on the page in Google Chrome
var items = Array.prototype.slice.call(
document.querySelectorAll('*')
).map(function(element) {
var listeners = getEventListeners(element);
return {
element: element,
listeners: Object.keys(listeners).map(function(k) {
return { event: k, listeners: listeners[k] };
})
};
#!/bin/sh
#########################
## PASSWORD GEN SCRIPT ##
## -drewzh.com- ##
#########################
echo "Please enter your master password:"
stty -echo
read -r master
stty echo
@yarkovaleksei
yarkovaleksei / mongod
Last active March 10, 2017 16:10 — forked from madhums/mongod
mongod init script. Placed in /etc/init.d/mongod
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mongodb startup script
# Description: Mongodb start stop daemon sends SIGINT to terminate
# say man signal to see details
# Please check the startup params and replication options
(function(){
const links = document.querySelectorAll('a.comment__reply[href^="#mention"]');
for (let i = 0; i < links.length; i++) {
let link = links[i];
let login = link.dataset.username;
let parent = link.parentElement;
let form = parent.parentElement.parentElement.parentElement.nextElementSibling;
let textarea = form.querySelector('textarea.form__input');
@yarkovaleksei
yarkovaleksei / git-deployment.md
Created February 22, 2017 18:36 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

var crypto = require('crypto');
var express = require('express');
var app = express();
var blowfishCipher = crypto.createCipher('blowfish', "asdf");
app.locals.root_path = __dirname;
var crypting = function( text, algorithm, crypt ){
var cipher;
data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=
map $http_upgrade $connection_upgrade {
default "upgrade";
"" "";
}
server {
listen 80;
location / {
proxy_pass http://docker;
# Простой пример
server {
listen 80;
server_name localhost;
charset koi8-r;
location / {
root /var/www/nodejs/public;
index index.html;
try_files $uri $uri/ @backend;