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 | |
/* For AJAX, if frustrated, try the following (see http://www.php.net/manual/en/function.flush.php#91556): | |
@apache_setenv('no-gzip', 1); | |
@ini_set('zlib.output_compression', 0); | |
*/ | |
ob_start(); | |
set_time_limit(0); // for scripts that run really long | |
function force_flush ($add_whitespace = TRUE) { |
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
/* Deletes files recursively on windows and linux */ | |
function delTree($dir) { | |
$files = array_diff(scandir($dir), array('.','..')); | |
foreach ($files as $file) { | |
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file"); | |
} | |
return rmdir($dir); | |
} |
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
var str = '/var/www/./../html/.././webkit'; | |
var str2 = './var/www/./html/testdir/../assets/.'; | |
function normalizeUnix(string) { | |
var arr = string.split('/'); | |
if(arr[0] == '') | |
arr.splice(0, 1); | |
for(var i = 0; i < arr.length; i++) { | |
if(arr[i] == '.') { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Bootstrap Example</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> |
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
/* ============================================================== | |
==== ES5 Classes | |
================================================================*/ | |
'use strict'; | |
function Shape(id, x, y) { | |
this.id = id; | |
this.setLocation(x, y); | |
} |
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
[ | |
{ | |
"ext":"adp", | |
"description":"Access Project (Microsoft)" | |
}, | |
{ | |
"ext":"app", | |
"description":"Executable Application" | |
}, | |
{ |
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
'use strict'; | |
/* | |
* Binary search tree with in-order iteration. | |
* http://greim.github.io/gen/dist/00-intro.html | |
*/ | |
class Tree { | |
add(value) { | |
if (this.root) this.root.add(value); |
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
REM generateTestFile.bat testFileName.txt 900000 | |
fsutil file createnew %1 %2 |
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
history -cw | |
// or | |
reset |
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
/* =================== jQuery ===================== */ | |
$(document).ajaxSend(function() { | |
alert("Triggered ajaxSend hook."); | |
}); | |
$('#clickBtn').click(function() { | |
$.getJSON("https://crossorigin.me/https://api.darksky.net/forecast/037352c0951701a563b624359ea6111f/42.3601,-71.0589", function(json) { | |
console.log("JSON Data:", json); | |
}); |
OlderNewer