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 | |
$db_con = mysqli_connect("localhost", "username", "password", "database"); | |
$result = $db_con->query('SELECT * FROM some_table'); | |
if (!$result) die('Couldn\'t fetch records'); | |
$num_fields = mysqli_num_fields($result); | |
$headers = array(); | |
while ($fieldinfo = mysqli_fetch_field($result)) { | |
$headers[] = $fieldinfo->name; | |
} | |
$fp = fopen('php://output', 'w'); |
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
/* A facade for the Web Worker API that fakes it in case it's missing. | |
Good when web workers aren't supported in the browser, but it's still fast enough, so execution doesn't hang too badly (e.g. Opera 10.5). | |
By Stefan Wehrmeyer, licensed under MIT | |
*/ | |
var WorkerFacade; | |
if(!!window.Worker && !iCanHasFastBrowser()){ | |
WorkerFacade = (function(){ | |
return function(path){ | |
return new window.Worker(path); |
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
import java.net.*; | |
import java.io.*; | |
class urllib { | |
public static StringBuffer urlopen(String url) { | |
try { | |
URL u = new URL(url); | |
StringBuffer sb = new StringBuffer(); | |
BufferedReader in = new BufferedReader( |