Skip to content

Instantly share code, notes, and snippets.

View shadow-fox's full-sized avatar

Pranaya Behera shadow-fox

  • Bangalore,India
View GitHub Profile
@shadow-fox
shadow-fox / sudo
Created November 10, 2012 07:01
iceweasel
sisyphus@shadowfox:~$ sudo aptitude install iceweasel
The following NEW packages will be installed:
iceweasel libmozjs16d{a} libnspr4{ab} xulrunner-16.0{a}
0 packages upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.7 MB of archives. After unpacking 37.2 MB will be used.
The following packages have unmet dependencies:
libnspr4: Conflicts: libnspr4-0d (< 2:4.9-2~) but 4.8.6-1 is installed.
The following actions will resolve these dependencies:
Remove the following packages:
@shadow-fox
shadow-fox / index.html
Created November 12, 2012 05:47
Simple Invoice Template HTML
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="http://localhost/invoice/templates/invoices/a/style.css">
<title>cccc- Invoice No.10002</title>
</head>
<body class="rec">
<div id="container">
<table width="100%">
<tr>
<td><h4 align="left">heading</h4></span><span><p align="justify" style="font-size:11px; margin-left: 15px">ADdress<br/>
@shadow-fox
shadow-fox / team.index.js
Created January 16, 2014 14:11
Ember Error
import Team from 'lms/models/team';
var TeamsIndexRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('team', params.id);
}
});
export default TeamsIndexRoute;
@shadow-fox
shadow-fox / new.js
Created January 13, 2014 08:54
new session controller
import AuthManager from 'lms/config/auth_manager';
var SessionNewController = Ember.ObjectController.extend({
attemptedTransition : null,
loginText : 'Log In',
actions: {
loginUser : function() {
var self = this;
@shadow-fox
shadow-fox / auth_manager.js
Created January 13, 2014 06:23
session/new.js file contents
import User from 'lms/models/user';
import Application from 'lms/adapters/application';
var AuthManager = Ember.Object.extend({
init: function() {
this._super();
var accessToken = $.cookie('access_token');
var authUserId = $.cookie('auth_user');
if(!Ember.isEmpty(accessToken) || !Ember.isEmpty(authUserId)) {
this.authenticate(accessToken, authUserId);
@shadow-fox
shadow-fox / error console log
Created January 13, 2014 05:57
emberjs auth error
Uncaught TypeError: Object function () {
if (!wasApplied) {
Class.proto(); // prepare prototype...
}
o_defineProperty(this, GUID_KEY, undefinedDescriptor);
o_defineProperty(this, '_super', undefinedDescriptor);
var m = met...<omitted>...e' new.js:25
(anonymous function) new.js:25
fire jquery.js:1037
self.fireWith jquery.js:1148
@shadow-fox
shadow-fox / controoller.php
Created January 9, 2014 15:39
controller
namespace User\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;
use Zend\Json\Json;
class LoginController extends AbstractActionController {
public function indexAction() {
return new JsonModel(array('data' => $this->getRequest('post')->getPost()));
}
@shadow-fox
shadow-fox / req
Created January 9, 2014 12:41
CORs Headers
Request URL:http://rest.api/login
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:76
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
@shadow-fox
shadow-fox / pdo.php
Created January 8, 2014 12:07
pdo error
Warning: PDO::quote() expects parameter 1 to be string, array given in /home/shafox/Work/Office/appapi/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Mysql.php on line 120
public function createUser(UserMapper $user) {
$insert = $this->sql->insert($this->table);
$insert->values($user->getNotNullArrayCopyForAuthentication());
echo $this->sql->getSqlStringForSqlObject($insert);exit;
try {
return $this->adapter->query($this->sql->getSqlStringForSqlObject($insert),Adapter::QUERY_MODE_EXECUTE);
} catch(\Exception $e) {
var_dump($e->getMessage());exit;
@shadow-fox
shadow-fox / a.php
Created January 8, 2014 10:31
jsonmodel
shafox@archon:~/Work/Office/appapi$ curl -i -H "Accept: application/json" -X POST -d "artist=AC DC&title=Dirty Deeds" http://rest.api/user
HTTP/1.1 200 OK
Date: Wed, 08 Jan 2014 10:10:46 GMT
Server: Apache/2.4.6 (Ubuntu)
X-Powered-By: PHP/5.5.7-1+sury.org~precise+1
Content-Length: 60
Content-Type: application/json; charset=utf-8
{"userCredentials":{"artist":"AC DC","title":"Dirty Deeds"}}shafox@archon:~/Work/Office/appapi$