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 | |
function num_forvietnamese($num = false) | |
{ | |
$str = ''; | |
$num = trim($num); | |
$f = number_format($num); | |
$arr = str_split($f); |
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
.text-overflow{ | |
display: block; | |
display: -webkit-box; | |
-webkit-line-clamp: 2; // Line number | |
-webkit-box-orient: vertical; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} | |
.list-column-wrapping { |
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
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' /> |
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
<header> | |
Header | |
</header> | |
<script> | |
$(document).ready(function () { | |
var lastScroll = 0; | |
$(window).scroll(function(event){ | |
var st = $(this).scrollTop(); | |
// Make sure they scroll more than delta |
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
<section> | |
<div class="sticky">This div will stick to the top</div> | |
</section> | |
<script> | |
$(window).scroll(function(){ | |
var sticky = $('.sticky'), | |
scroll = $(window).scrollTop(); | |
if (scroll >= 100) sticky.addClass('fixed'); |
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
public static List<String> findNotMatching(String sourceStr, String anotherStr){ | |
String new_souce = sourceStr.replaceAll("[^a-zA-Z ]", "").toLowerCase(); | |
anotherStr = anotherStr.replaceAll("[^a-zA-Z ]", "").toLowerCase(); | |
StringTokenizer at = new StringTokenizer(new_souce, " "); | |
StringTokenizer bt = null; | |
int i = 0, token_count = 0; | |
String token = null; | |
boolean flag = false; | |
List<String> missingWords = new ArrayList<String>(); |
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 trim(str, charlist) { | |
// example 1: trim(' Kevin van Zonneveld ') | |
// returns 1: 'Kevin van Zonneveld' | |
// example 2: trim('Hello World', 'Hdle') | |
// returns 2: 'o Wor' | |
// example 3: trim(16, 1) | |
// returns 3: '6' | |
let whitespace = [ | |
' ', |
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 | |
$unzip = new ZipArchive; | |
$out = $unzip->open('file-name.zip'); | |
if ($out === TRUE) { | |
$unzip->extractTo(getcwd()); | |
$unzip->close(); | |
echo 'File unzipped'; | |
} else { | |
echo 'Something went wrong?'; |
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
.text-overflow{ | |
display: -webkit-box; | |
-webkit-line-clamp: 2; | |
-webkit-box-orient: vertical; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} |