# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Semantic UI has these classes, however they're only applicable to*/ | |
/* grids, containers, rows and columns.*/ | |
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/ | |
/* this snippet is using the same class names and same approach*/ | |
/* plus a bit more but to all elements.*/ | |
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/ | |
/* Mobile */ | |
@media only screen and (max-width: 767px) { | |
[class*="mobile hidden"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check out to a temporary branch: | |
git checkout --orphan TEMP_BRANCH | |
# Add all the files: | |
git add -A | |
# Commit the changes: | |
git commit -am "Initial commit" | |
# Delete the old branch: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertMS(ms) { | |
var d, h, m, s; | |
s = Math.floor(ms / 1000); | |
m = Math.floor(s / 60); | |
s = s % 60; | |
h = Math.floor(m / 60); | |
m = m % 60; | |
d = Math.floor(h / 24); | |
h = h % 24; | |
return { d: d, h: h, m: m, s: s }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name xxx.xxx.xxx.xxx; | |
# or | |
# server_name default_server | |
return 301 $scheme://domain.com$request_uri; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!function_exists("add_var_to_url")){ | |
function add_var_to_url($variable_name,$variable_value,$url_string){ | |
// first we will remove the var (if it exists) | |
// test if url has variables (contains "?") | |
if(strpos($url_string,"?")!==false){ | |
$start_pos = strpos($url_string,"?"); | |
$url_vars_strings = substr($url_string,$start_pos+1); | |
$names_and_values = explode("&",$url_vars_strings); | |
$url_string = substr($url_string,0,$start_pos); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// can remove variables from: full url, from urls related to site root, form just a query string like "a=1&b=2" | |
if(!function_exists("remove_var_from_url")){ | |
function remove_var_from_url($variable_name, $url_string){ | |
// this is anything before the "?" sign | |
$base_url = ''; | |
// the variable separator, can be "?" if is a full URL or can be empty, if we just have "&sort=sales&oprder=asc" | |
$separator = ""; | |
$start_pos = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_GET['sort'])) { | |
$query = $_GET; | |
if($_GET['sort']=='ASC') { | |
$query['sort'] = 'DESC'; | |
} else { | |
$query['sort'] = 'ASC'; | |
} | |
$query_result = http_build_query($query); |
NewerOlder