Skip to content

Instantly share code, notes, and snippets.

View licvido's full-sized avatar

Filip Mikovcak licvido

View GitHub Profile
@licvido
licvido / regex.md
Created September 30, 2017 11:32
RegEx: Passwords

Minimum eight characters, at least one letter and one number:

^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$

Minimum eight characters, at least one letter, one number and one special character:

^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$
@licvido
licvido / http-codes.php
Created December 28, 2016 21:25
PHP: HTTP Status Codes
<?php
$items = array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
@licvido
licvido / gist:87c1eee32b90b44d0b7e2fa09ea63cc7
Last active January 10, 2018 19:53 — forked from wavecos/gist:4dcb1410a41b9dd521cb
Present Modal ViewController when tap a TabBarItem (like camera VC in Instagram)
// 1. First Create a Dummy UIViewController that has a root relation with the UITabBarController
// 2. Make this controller implement a UITabBarControllerDelegate
// 3. In ViewDidLoad:
override func viewDidLoad() {
super.viewDidLoad()
self.tabBarController?.delegate = self
}
// 4. Implement this delegate method:
func tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) {
let isModalTab = viewController == self
@licvido
licvido / README-Template.md
Created August 12, 2016 07:29 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisities

@licvido
licvido / README.md
Created August 12, 2016 07:28 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@licvido
licvido / redmine-3.2.1-on-ubuntu-14.04
Last active August 24, 2018 11:46 — forked from wenzhixin/redmine-3.0.2-on-ubuntu-14.04
redmine 3.2.1 installer on ubuntu 14.04 (new installtion) with nginx, mysql and puma
# set cache proxy
sudo vi /etc/apt/apt.conf << EOT
Acquire::http::Proxy "http://192.168.88.10:3142";
Acquire::HTTP::Proxy::192.168.88.10 "DIRECT";
EOT
sudo apt-get update
sudo apt-get upgrade
@licvido
licvido / ubuntu-php7-install.bash
Created March 25, 2016 01:30
Ubuntu 14.04 PHP7 (Install from Source)
#!/usr/bin/env bash
sudo -i;
apt-get update;
apt-get install --yes \
git \
bison \
autoconf \
@licvido
licvido / speedometer.sh
Created February 27, 2016 12:07
BASH: Speedometer, current traffic
#!/bin/bash
speedometer -l -r eth0 -t eth0 -m $(( 1024 * 1024 * 2 ))
@licvido
licvido / commands.sh
Created December 10, 2015 21:00
Install PHP7
sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get update
sudo apt-get install php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm php7.0-curl php7.0-gd
php -v
@licvido
licvido / git.migrate
Created October 16, 2015 10:26 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.