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
greg@ubuntu:/var/www/silk/lib$ git status | |
# On branch master | |
# Changed but not updated: | |
# (use "git add/rm <file>..." to update what will be committed) | |
# | |
# deleted: ../config/routes.php.orig | |
# deleted: ../config/setup.yml.orig | |
# modified: ../index.php | |
# modified: silk/classes/class.silk_ajax.php | |
# modified: silk/classes/class.silk_application.php |
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 editAboutMe_ajax($params) { | |
$form = SilkForm::create_form_start(array("remote" => "true", "url" => "/silk/mp/portfolio/saveAboutMe_ajax")); | |
$form .= SilkForm::create_input_textarea(array("value" => $params["description"], "cols" => "60", "name" => "description")); | |
$form .= SilkForm::create_input_hidden(array("name" => "id", "value" => $params["id"])); | |
$form .= "<br />"; | |
$form .= silkform::create_input_submit(array("value" => "Save")); | |
$form .= SilkForm::create_form_end(); | |
$this->show_layout = false; |
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
/** | |
* Fills an object with posted form variables | |
* | |
* @param array Contains hash of values to load into the object (used in conjunction with SilkForm::auto_form) | |
*/ | |
function fill_object_form($params) { | |
foreach($params as $key=>$value) { | |
$this->$key = $value; | |
} | |
} |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>{$title}</title> | |
{javascript file="lib/silk/jquery/jquery.js"} | |
{javascript file="lib/silk/jquery/jquery.color.js"} | |
{javascript file="lib/silk/jquery/jquery.silk.js"} | |
{stylesheet} |
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
object(__PHP_Incomplete_Class)#3 (16) { | |
["__PHP_Incomplete_Class_Name"]=> | |
string(6) "mpUser" | |
["params"]=> | |
array(11) { | |
["id"]=> | |
string(2) "26" | |
["username"]=> | |
string(9) "braindead" | |
["password"]=> |
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 mpUser extends SilkUser { | |
public function __construct(){ | |
parent::__construct(); | |
} | |
public function setup() { | |
$this->create_has_many_association("friends", "Friend", "user_id"); | |
$this->create_has_many_association("activity", "UserActivity", "user_id"); | |
// $this->create_belongs_to_association("activity", "user_activity", "user_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
$friendsActivity = orm("UserActivity")->find_all(array("join" => array("INNER JOIN silk_friends on friends.user_id = silk_user_activity.user_id"), "conditions" => array("friends.user_id = ?", $params["user_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
public function editAboutMe_ajax($params) { | |
$this->show_layout = false; | |
$resp = new SilkAjax(); | |
$this->set("params", $params); | |
$this->set("formType", "edit"); | |
$resp->replace_html("#AboutMe", $this->render_partial("edit_about_me_ajax.tpl")); | |
return $resp->get_result(); | |
} |
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
## RubyMotion | |
imageData = UIImage.UIImageJPEGRepresentation(@image_view.image, 1) | |
encodedData = [imageData].pack("m0") | |
data["image"] = encodedData | |
BW::HTTP.post("http://localhost:3000/upload}", {payload: data}) do |response| | |
if response.ok? | |
end | |
end |
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
var rpc = require('amqp-rpc').factory({ | |
url: "amqp://guest:guest@localhost:5672" | |
}); | |
module.exports = function(req, res, next) { | |
var jwt = require('jwt-simple'); | |
token = (req.body && req.body.access_token) || (req.query && req.query.access_token) || req.headers['x-access-token']; | |
rpc.call('profile.confirmToken', {token: token}, function(result, user, msg) { |
OlderNewer