Skip to content

Instantly share code, notes, and snippets.

@shehabic
shehabic / Ansible-Laravel-Deployment-Playbook.yml
Created November 27, 2020 03:38
Ansible Laravel Deployment Playbook (for Centos) but Ubuntu should be similar as well
# This is an example file to display laravel project directly through Ansible
# assuming that you have a folder /var/www/my_website with "shared" and "releases" subfolders,
# "shared" subfolder has "bootstrap/cache" and "storage/cache", "storage/sessions", "storage/views" subfolders as well as "logs"
#
# - also assuming that your ssh user has access to github (his keys are added to github)
# - also assuming you have installed composer and git on your deployment server:
---
- hosts: all
tasks:
public class RegexMatchDP {
public static void test() {
RegexMatchDP sut = new RegexMatchDP();
String[][] samples = new String[][]{
{"abcdefg", "a*b*c*de.*"},
{"abcdefg", ".*"},
{"abcdefg", "ad.*"}, // no match
{"abcdf", "a*b*c*de.*"}, // no match
{"airbnb", "a*.*b*"},
};
@shehabic
shehabic / TrieDictionaryWildCard.java
Last active March 19, 2020 13:26
Dictionary Search With Wildcard Implemented using Trie in Java
public class TrieDictionaryWildCard
public static class TrieNode {
public boolean end = false;
public final Map<Character, TrieNode> children = new HashMap<>();
}
public static class TrieFinder {
private final char wildcard;