Skip to content

Instantly share code, notes, and snippets.

@duccoder
duccoder / exportCSV.php
Last active August 29, 2015 14:06
Get csv from table mysql use php
<?php
$dbHost = 'localhost';
$dbUser = 'root';
$dbPass = '';
$dbName = 'blog'; //database name
$table= 'users'; //table name you need export
$fileName = 'export';
//try connect
@duccoder
duccoder / slurpy.php
Last active August 29, 2015 14:01
Use Slurpy Basic
<?php
use Shuble\Slurpy\Operation\OperationArgument\PageRange;
$inputs = array(
'/path/to/file1.pdf',
'/path/to/file2.pdf',
array(
'filepath' => '/path/to/file3.pdf',
'password' => 'pa$$word',
'start_page' => 1,
'end_page' => 'end',
@duccoder
duccoder / for-each.html
Last active August 29, 2015 14:01
For & Each
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
//array arr
var arr = new Array();
var i=0;
for (i; i<100000; i++) {
arr[i] = i;
}
//use for
@duccoder
duccoder / validEmail.html
Last active August 29, 2015 14:01
Valid Email with JS
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<form>
<label for="regExField">Email: </label>
<input id="regExField" type="text">
<span id="messageExField"></span>
</form>
<script type="text/javascript">
$(document).ready(function () {
function checkEmailValid(str) {
var regEx = /^.{1,}@.{2,}\..{2,}/;