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
/** | |
* API prototype class. Uses strict ECMA convention. | |
* This class requires jQuery. | |
* | |
* @category Prototype | |
* @author Muntasir Mohiuddin | |
*/ | |
var API; |
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 | |
ini_set('precision', 20); | |
?> | |
<!-- Decreased Latency --> | |
<!-- Increased parallelism --> | |
<!-- Better caching --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
<script src="js/mustache.js" type="text/javascript"></script><!-- --> | |
<script> |
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 | |
/* | |
Copyright (c) 2011 Muntasir Mohiuddin<[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 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
public function before(){ | |
parent::before(); | |
// this block provides header information for facebook send message popup | |
if( preg_match('/facebook/', $_SERVER['HTTP_USER_AGENT'])) { | |
$facebook_config = kohana::$config->load('facebook'); | |
$share = $facebook_config['share'][$this->lang]; | |
$item_id = $this->request->query('id'); | |
$media = ORM::factory('Media', $item_id)->as_array(); |
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
#!/usr/bin/env python | |
''' | |
Change Facebook test users password | |
''' | |
import urllib, urllib2, json | |
# makes a batch call to facebook | |
# access_token : facebook access token |
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
args.batch.push({ | |
method : "GET", | |
name : "get-users", | |
relative_url : "/"+app.id+"/accounts/test-users", | |
omit_response_on_success : false | |
}); | |
args.batch.push({ | |
method : "GET", | |
relative_url : "?ids={result=get-users:$.data.*.id}" |
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
class Controller_Home extends Controller { | |
protected $args; // store GET/POST variables | |
public function before() { | |
parent::before(); | |
// if a GET request | |
if( $this->request->method() == "GET" ) { | |
$this->args = $this->request->query(); |
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 | |
send_push($_REQUEST['alert'], $_REQUEST['appkey'], $_REQUEST['appmaster']); | |
function send_push($alert, $appkey, $appmaster) { | |
$badge = 1; // default is 1 | |
$auth = $appkey . ":" . $appmaster; | |
$url = "https://go.urbanairship.com/api/push/broadcast/"; |
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 // php csv_parser.php <table name> <csv target> <sql target> | |
ini_set('memory_limit', '8000M'); | |
ini_set('max_execution_time', 3000); | |
if (empty($argc)) { | |
echo "Arguments missing"; | |
exit(1); | |
} | |
if (!strstr($argv[0], basename(__FILE__))) { |
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 | |
// GENERATE TABLE FROM FIRST LINE OF CSV FILE | |
$inputFile = 'csv/sample.csv'; // path to CSV file | |
$tableName = 'csv'; // table name | |
$fh = fopen($inputFile, 'r'); | |
$contents = fread($fh, 5120); // 5KB | |
fclose($fh); |
OlderNewer