Skip to content

Instantly share code, notes, and snippets.

View ruslankonev's full-sized avatar
:octocat:
Make a good things

Ruslan Konev ruslankonev

:octocat:
Make a good things
View GitHub Profile
@ruslankonev
ruslankonev / Policy.vue
Created July 5, 2018 15:51 — forked from edfialk/Policy.vue
Using Content Tools in vue
/*
* A page where users ("agents") can edit text on a page template that is filled with model data when displayed for guests.
* Uses content tools library: http://getcontenttools.com/
* Agents can enter #variable# to display client model data inside text blocks (e.g. client name, etc.)
*/
<template>
<div>
<div ref="policy"
@ruslankonev
ruslankonev / WYSIWYG.md
Created July 5, 2018 15:10 — forked from monolithed/WYSIWYG.md
WYSIWYG редакторы

Модуль должен соответствовать следующим требованиям:

  • Свободная лицензия (в идеале)
  • API
  • Масштабировать текст по количеству символов (в идеале)
  • Быть кроссбраузерным IE9+
  • Сокращать ссылки и подсвечивать ссылки
  • Иметь защиту от XSS
  • Конфигурироваться
  • Поддерживать историю
@ruslankonev
ruslankonev / async-foreach.js
Created June 1, 2018 12:06 — forked from Atinux/async-foreach.js
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@ruslankonev
ruslankonev / README.md
Created January 10, 2018 12:42 — forked from dominikwilkowski/README.md
Ubuntu 16.04 setup with NGINX http/2 and letsencrypt

Intro

This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.

Basics

After creating the server (droplet on DigitalOcean) log in with

@ruslankonev
ruslankonev / satoshi.htm
Created December 6, 2017 16:01 — forked from rbreve/satoshi.htm
Satoshi Dice Simulator Javascript
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<style type="text/css" media="screen">
body{font-family:helvetica;}
.abutton{width:350px;height:200px;}
.green{color:green;}
.red{color:red;}
#
# REQUIRES:
# - server (the forge server instance)
# - site_name (the name of the site folder)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - event_id (the provisioning event name)
# - callback (the callback URL)
#
@ruslankonev
ruslankonev / setup-dev.sh
Created November 9, 2015 08:48
Install homebrew, nginx, mysql, php55, and composer on Mac OS X
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
@ruslankonev
ruslankonev / godaddy-ssl-howto
Last active September 8, 2015 11:03 — forked from ideaoforder/godaddy-ssl-howto
GoDaddy + Nginx SSL
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
http://support.godaddy.com/help/article/3601/generating-a-certificate-signing-request-nginx
http://support.godaddy.com/help/article/4976/rekeying-an-ssl-certificate
# Be sure to remember to chain them!
cat gd_bundle-g2-g1.crt >> yourdomain.crt
# Move 'em
sudo mv yourdomain.crt /etc/ssl/certs/yourdomain.crt
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
<?php
/*
* Multilingual URLs in Laravel 4
*/
//config/app.php
return array(
...