This file contains 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
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, LOCK TABLES, INDEX ON db_name.* TO db_username@localhost IDENTIFIED BY 'super duper secret password'; |
This file contains 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
#!/bin/bash | |
# Public domain license | |
# Not original author: Remigijus Jarmalavičius | |
# | |
# Usage: | |
# pomodoro "title for work" | |
filename="/home/remigijus/Kodas/smelio-deze/`date '+%Y-%m-%d'`.log" | |
This file contains 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
ssh-keygen -b 4048 -t rsa -C "Description for secure key" |
This file contains 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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |
This file contains 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
#div { | |
min-height: 500px; | |
height:auto !important; | |
height: 500px; | |
} |
This file contains 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 | |
function downloadFile($file){ | |
$file_name = $file; | |
$mime = 'application/force-download'; | |
header('Pragma: public'); // required | |
header('Expires: 0'); // no cache | |
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); | |
header('Cache-Control: private',false); | |
header('Content-Type: '.$mime); |
This file contains 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 | |
function get_real_ip() { | |
$proxy_headers = array( | |
'CLIENT_IP', | |
'FORWARDED', | |
'FORWARDED_FOR', | |
'FORWARDED_FOR_IP', | |
'HTTP_CLIENT_IP', | |
'HTTP_FORWARDED', |
This file contains 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 | |
function genRandomString($length) { | |
$characters = "0123456789abcdefghipqrstuvwxyz"; | |
$string = ""; | |
for ($p = 0; $p < $length; $p++) { | |
$string .= $characters[mt_rand(0, strlen($characters) - 1)]; | |
} | |
return $string; | |
} |
This file contains 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 | |
function startsWith($haystack, $needle) { | |
return !strncmp($haystack, $needle, strlen($needle)); | |
} | |
function endsWith($haystack, $needle) { | |
$length = strlen($needle); | |
if ($length == 0) { | |
return true; |
OlderNewer