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
/** | |
* Simple demo for adding swipe detection on a table view row. Since the row is simply a container | |
* of views, you'll want to generally create a hidden view the size of the row and add your swipe listener | |
* to this view for detection. We need to improve Titanium so you don't have to do this in the future... | |
*/ | |
var win = Ti.UI.createWindow(); | |
var data = []; | |
for (var c=0;c<10;c++) | |
{ |
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
$.fn.chain = function(func) { | |
func.apply(this); | |
return this; | |
} | |
$('#my-div') | |
.fadeIn() | |
.chain(function(){ | |
// Do something here | |
// You can even use $(this) on your original element |
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 | |
class SayNothing | |
{ | |
public function howToAct() | |
{ | |
return 'If you can\t say anything nice, then don\'t say anything at all'; | |
} | |
} |
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 | |
$identifiers = [ | |
['contact', 1], | |
['company', 2], | |
['contact', 4], | |
['company', 3] | |
]; | |
foreach ($identifiers as list($type, $id)) { | |
echo ucfirst($type) . ' - ' . $id . "\n"; |
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 | |
$hostname = "localhost"; | |
$db_user = "swade_steven"; | |
$db_password = "yeahman"; | |
$db_table = "upstate_show"; | |
$db = mysql_connect($hostname, $db_user, $db_password); | |
mysql_select_db("swade_information"); |
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 | |
function makeRequest(int $delay) | |
{ | |
$client = new Amp\Artax\DefaultClient; | |
echo "Making request [delay = $delay]\n"; | |
$response = yield $client->request('https://mockbin.org/delay/' . $delay); | |
echo "Response received [delay = $delay]\n"; |
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 | |
require_once 'vendor/autoload.php'; | |
function client() | |
{ | |
static $client; | |
$client = $client ?? new GuzzleHttp\Client; | |
return $client; | |
} |
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 | |
$arr_1 = ['foo']; | |
$arr_2[] = 'foo'; | |
var_dump( | |
$arr_1, | |
$arr_2 | |
); |