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 getBook($isbn){ | |
$region = "com"; | |
$method = 'GET'; | |
$host = 'webservices.amazon.'.$region; | |
$uri = '/onca/xml'; | |
$ass_tag = Config::get('env_vars.amazon_ass_tag'); | |
$public_key = Config::get('env_vars.amazon_public_key'); |
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 | |
namespace api; | |
use Illuminate\Support\Facades\View; | |
use Illuminate\Routing\Controllers\Controller; | |
class SupplyOrdersController extends \Controller { | |
protected static $restful = true; | |
public function update($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
[2014-01-27 09:23:09.563241] I [glusterd-volume-ops.c:83:glusterd_handle_create_volume] 0-glusterd: Received create volume req | |
[2014-01-27 09:23:09.564165] I [glusterd-utils.c:285:glusterd_lock] 0-glusterd: Cluster lock held by c1e014dd-5de5-4d04-8bcb-e4f9754503e3 | |
[2014-01-27 09:23:09.564191] I [glusterd-handler.c:463:glusterd_op_txn_begin] 0-management: Acquired local lock | |
[2014-01-27 09:23:09.565151] I [glusterd-rpc-ops.c:548:glusterd3_1_cluster_lock_cbk] 0-glusterd: Received ACC from uuid: c9919ca3-6e14-480b-bd20-ed0d63a66d95 | |
[2014-01-27 09:23:09.565220] I [glusterd-rpc-ops.c:548:glusterd3_1_cluster_lock_cbk] 0-glusterd: Received ACC from uuid: 27aece02-873c-4cd7-bc31-eb84b659bed4 | |
[2014-01-27 09:23:09.566008] W [glusterd-utils.c:4920:mkdir_if_missing] 0-: Failed to create the directory /var/export/www | |
[2014-01-27 09:23:09.566035] E [glusterd-op-sm.c:1999:glusterd_op_ac_send_stage_op] 0-: Staging failed | |
[2014-01-27 09:23:09.566055] I [glusterd-op-sm.c:2039:glusterd_op_ac_send_stage_op] 0-glusterd: Sent op r |
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
App::uses('CsvFileObject', 'Lib'); | |
App::uses('CsvIterator', 'Lib'); | |
//... | |
public function upload() { | |
$file = $this->data['Book']['file']; | |
if ($file['error'] === UPLOAD_ERR_OK) { | |
if (move_uploaded_file($file['tmp_name'], APP.'webroot/uploads'.DS.$file['name'])) { | |
$path = APP.'webroot/uploads'.DS.$file['name']; | |
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
Symfony \ Component \ HttpFoundation \ File \ Exception \ FileException | |
Unable to create the "/home/rahl/www/recycleabook.com/files/" directory | |
open: /home/rahl/www/recycleabook.com/rab/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php | |
return $target; | |
} | |
protected function getTargetFile($directory, $name = null) | |
{ | |
if (!is_dir($directory)) { | |
if (false === @mkdir($directory, 0777, true)) { |
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
from django.db import models | |
import datetime | |
from django.utils import timezone | |
# Create your models here. | |
class Poll(models.Model): | |
question = models.CharField(max_length=200) | |
pub_date = models.DateTimeField('date published') | |
def __unicode__(self): | |
return self.question |
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 | |
Route::get('/testbal', function(){ | |
Httpful\Bootstrap::init(); | |
RESTful\Bootstrap::init(); | |
Balanced\Bootstrap::init(); | |
Balanced\Settings::$api_key = "TEST-MP4ILBwvLbXhtYjRrGA6qlwx"; | |
$m = Balanced\Marketplace::mine(); | |
var_dump($m); | |
//$marketplace = Balanced\Marketplace::mine(); |
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 User < ActiveRecord::Base | |
validates_confirmation_of :password | |
before_save :encrypt_password | |
def encrypt_password | |
self.password_salt = BCrypt::Engine.generate_salt | |
self.password_hash = BCrypt::Engine.hash_secret(password, password_salt) | |
end | |
def self.auth(email, 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
// Bonfire: Meet Bonfire | |
// Author: @patrickcurl | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-meet-bonfire# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function meetBonfire(argument) { | |
// Good luck! | |
console.log("you can read this function's argument in the developer tools", argument); | |
return true; |
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
// Bonfire: Reverse a String | |
// Author: @patrickcurl | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-reverse-a-string# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function reverseString(str) { | |
return str.split('').reverse().join(''); | |
} | |
reverseString("hello"); |