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 | |
| $longUrl = 'http://facebook.com'; | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| curl_setopt($ch, CURLOPT_URL, 'http://goo.gl/api/shorten'); | |
| curl_setopt($ch, CURLOPT_POST, true); | |
| curl_setopt($ch, CURLOPT_POSTFIELDS, 'security_token=null&url='.$longUrl); | |
| $content = curl_exec($ch); | |
| curl_close($ch); |
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 | |
| /** | |
| * Created by Ryan J | [email protected] | |
| * Date: | |
| * Version : v1.1 | |
| */ | |
| include("config.ini.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 | |
| include('lib/limonade.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 | |
| include('lib/limonade.php'); | |
| dispatch_get('/', function() { | |
| return "Hello, World!"; | |
| }); | |
| run(); |
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('lib/limonade.php'); | |
| dispatch_get('/','get_todo_list'); | |
| dispatch_post('/','add_todo'); | |
| dispatch_get('/:id','get_todo'); | |
| dispatch_put('/:id','update_todo'); | |
| dispatch_delete('/:id','delete_todo'); |
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 | |
| function configure() { | |
| $c = mysql_connect('localhost','root',''); | |
| $s = mysql_select_db('todo',$c); | |
| } | |
| ?> |
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 | |
| /** | |
| * A quick little function to interact with a MySQL database. | |
| * | |
| * When working with Limonade-php a full-fledged MySQL wrapper seems like | |
| * overkill. This method instead accepts any mysql statement and if it works | |
| * returns either the result or the number of rows affected. If neither worked, | |
| * then it returns false | |
| * | |
| * @param string $sql the sql statement you want to execute |
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
| mysqldump --user=username --password=1234 --databases your_database --opt --quote-names --allow-keywords --complete-insert > your_database.sql.bz2 |
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 | |
| $data = array( | |
| array( | |
| 'user_id' => 1, | |
| 'username' => 'skywalkl', | |
| 'email' => '[email protected]' | |
| ), | |
| array( | |
| 'user_id' => 2, | |
| 'username' => 'solohan', |
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 | |
| $res = db('select product_id,name,short_description from products order by name asc'); | |
| $dg = new OPCDataGrid($res); | |
| $dg->fields(array( | |
| 'name' => 'Product Name', | |
| 'short_description' => 'Description' | |
| )); |
OlderNewer