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
| #!/usr/bin/php | |
| <?php | |
| /* | |
| * Convert JSON file to CSV and output it. | |
| * | |
| * JSON should be an array of objects, dictionaries with simple data structure | |
| * and the same keys in each object. | |
| * The order of keys it took from the first element. | |
| * | |
| * Example: |
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
| #!/usr/bin/env php | |
| <?php | |
| $app = function($request) { | |
| $body = <<<EOS | |
| <!DOCTYPE html> | |
| <html> | |
| <meta charset=utf-8> | |
| <title>Hello World!</title> |
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 | |
| include("MYSQL2JSON.class.php"); | |
| //MySQL connect | |
| $c = mysql_connect("useawsfordbduuuh.c345tgxpm1uqz.us-east-1.rds.amazonaws.com", "login", "password!"); | |
| mysql_select_db("database"); | |
| $json = new MYSQL2JSON(); //Create an object | |
| $form = '<FORM | |
| <form action="index.php" method="post"> | |
| <label><input type="checkbox" name="col[]" value="Asphalt">Asphalt</label><br> |
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
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| var myData = Array(); //create the blank array variable | |
| //now add values to the array from PHP | |
| <?php |
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 | |
| $time = "Mon Apr 1 00:00:00 2013"; // Has a rando extra space for example purposes | |
| $pattern = '/\s\s+/'; // fix that rando extra space with regex and preg_replace() | |
| $str = preg_replace($pattern, ' ', $time); | |
| $str = strtotime($str); // convert the time to UNIX time using built-in strtotime() function of PHP | |
| $str = date('m/d/Y', $str); // use date() to convert accurate UNIX time to desired format | |
| echo "\n".$str."\n"; // big pimpin' | |
| ?> |
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
| sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -verbose -activate -restart -agent -allowAccessFor -allUsers -privs -all -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw CHANGETHISTOAPASSWORDFORYOU |
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 get_dpi($filename){ | |
| $a = fopen($filename,'r'); | |
| $string = fread($a,20); | |
| fclose($a); | |
| $data = bin2hex(substr($string,14,4)); | |
| $x = substr($data,0,4); | |
| $y = substr($data,0,4); | |
| return array(hexdec($x),hexdec($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
| wget -p -m -k -K -E http://your.website.com/ |
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
| =ImportData(CONCATENATE("http://maps.google.com/maps/geo?output=kml&q=",A1:D1)) |
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 getLatitudeLongitude($address) { | |
| var geocode = Maps.newGeocoder() | |
| .geocode($address); | |
| // See http://goo.gl/5mr1N for reference | |
| return geocode.results[0].geometry.location.lng + ', '+ geocode.results[0].geometry.location.lat; | |
| } | |
| function generateMap() { | |
| var address = "111 8 Ave., New York, NY 10011"; | |
| var mapUrl = Maps.newStaticMap() |