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() |
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
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |