Skip to content

Instantly share code, notes, and snippets.

View uonick's full-sized avatar
💪
Working hard

uonick uonick

💪
Working hard
View GitHub Profile
@tylerhall
tylerhall / strong-passwords.php
Created August 12, 2010 21:38
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
@alehandrof
alehandrof / subl-scopes
Last active November 23, 2023 20:09
scopes for sublime text schemes
comment
comment punctuation
comment.block.documentation
comment.block.preprocessor
comment.documentation
constant
constant.character
constant.character punctuation
constant.character.entity
constant.character.escape
@sukei
sukei / Router.php
Created February 19, 2014 15:21
A Router in a Tweet
<?php
/**
* The Router class is a fast and lightweight router (yes it is). It can handle
* a path and call the matching controller. If there is no match, then an
* exception will be throwned.
*
* ...and it fits in a tweet.
*
* @author Quentin Schuler aka Sukei <qschuler@neosyne.com>
@laptrinhcomvn
laptrinhcomvn / Sublime Text 3 cheating.md
Last active November 17, 2023 06:53
Sublime Text 3 patching

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .
@adamwathan
adamwathan / v-cloak.md
Last active February 26, 2023 14:26
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@gorbypark
gorbypark / coreos-ignition-docker-start-on-boot.MD
Last active April 18, 2021 20:29
Container Linux (CoreOS) and how to get docker to start on boot using ignition.

Container Linux (CoreOS), digitalocean and starting docker on boot

Container Linux (CoreOS) doesn't enable the docker systemd service by default. If you start a container with the --restart=always flag, for example, your container will not start up again automatically after a reboot. This may be desirable if you're running a cluster with an orchestration system that will handle this for you, but if you are using Container Linux with a single instance you might want your containers to start up by themselves. Of course you can easily enable to systemd service from the command line, but the best way is to pass an Ignition config file during the droplet creation process.

  1. Under the "Select additional options" section, select "User Data"
  2. In the box, paste the following Ignition config
{
  "ignition": { "version": "2.2.0" },
  "systemd": {
    "units": [{
 "name": "docker.service",

Более удобной и актуальной версией является эта статья с использованием traefik

https://gist.github.com/dancheskus/365e9bc49a73908302af19882a86ce52


Certbot и nginx, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам