Skip to content

Instantly share code, notes, and snippets.

View milosh012's full-sized avatar

Milos Janjic milosh012

View GitHub Profile
@milosh012
milosh012 / index.js
Created September 17, 2015 08:50
Forcing Laravel to recognise Angular request as Ajax
// you can put this in angular "run" method
// added this header so we can use Laravel Request::ajax() method on the backend
$http.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
@milosh012
milosh012 / gist:7452864
Last active December 28, 2015 05:49
Laravel people! Want to find out what SQL queries are run when you are going on some route... Simplest way is to specify event listener in the routes file. Here is example:
<?php
// routes.php
Event::listen('illuminate.query', function($sql) {
var_dump($sql);
});
_ = require 'underscore'
moment = require 'moment'
util = require 'util'
async = require 'async'
Twitter = require process.cwd() + '/lib/node/provider/twitter'
Facebook = require process.cwd() + '/lib/node/provider/facebook'
class Job
[
{
"orderNo":"772",
"storeName":"Zen c",
"storeId":107,
"itemsCount":2,
"name":"Green Bike, Red Bike",
"date":"2012\/06\/04",
"value":1249800,
"currencySymbol":"US$",
[
{
"DestinationAddress":{
"CountryCode":"AU",
"City":"Lane Cove",
"Division":"NSW",
"PostalCode":"2066",
"Line1":"Futoska 21",
"Line2":"",
"FirstName":"Milos",
<?php
$shipment = array('Packages' => array(
array(
'ValueAmount' => 123,
'ValueCurrency' => 'USD',
"Weight" => 2, //2x12x6x8
"Length" => 8,
"Width" => 6,
"Height" => 12,
{
rates: [
{
Id: 65634,
CurrencySymbol: "US$",
CurrencyCode: "USD",
CurrencyValue: 5.6,
CourierId: 7,
Courier: "USPS",
ServiceId: 64,
{
"shipments":[
{
"CollectionAddress":{
"CountryCode":"GB",
"City":"London",
"Division":null,
"PostalCode":"SE162AA",
"Line1":"Hawkstone Road",
"Line2":"",
{
"shipments":[
{
"CollectionAddress":{
"CountryCode":"GB",
"City":"London",
"Division":null,
"PostalCode":"SE162AA",
"Line1":"Hawkstone Road",
"Line2":"",
{
"rates":[
],
"meta":{
"Date":"2012-04-30",
"Today":"1335816983000",
"MailCallAvailable":true,
"CollectionCountry":"AU",
"DestinationCountry":"AU",