View Postman POST PUT Requests.txt
To make Postman work with POST/PUT requests... | |
https://laravel.com/docs/5.2/routing#csrf-x-csrf-token | |
In addition to checking for the CSRF token as a POST parameter, the Laravel VerifyCsrfToken middleware will also check for the X-CSRF-TOKEN request header. | |
1. Store the token in a "meta" tag at the top of your root view file (layouts/app.blade.php)... | |
<meta name="csrf-token" content="{{ csrf_token() }}"> | |
** If using jQuery, you can now instruct it to include the token in all request headers. | |
$.ajaxSetup({ |
View gist:cc6c2f6e85598a83ed6d0348fb1325e6
?ps_debug=true | |
// Add to URL and reload page - shows all analytics events being captured by the Data Layer in the console. | |
&ps_debug=true | |
// same query string except that it is not be used first. | |
analytics.debug(); | |
analytics.debug(false); |
View ReactJS: Play Nine Numbers Game
// bit.ly/s-pcs | |
var possibleCombinationSum = function(arr, n) { | |
if (arr.indexOf(n) >= 0) { return true; } | |
if (arr[0] > n) { return false; } | |
if (arr[arr.length - 1] > n) { | |
arr.pop(); | |
return possibleCombinationSum(arr, n); | |
} | |
var listSize = arr.length, combinationsCount = (1 << listSize); | |
for (var i = 1; i < combinationsCount ; i++ ) { |
View Pluralsight React.js: Numbers Selection: Changing the Answer
const Stars = (props) => { | |
// const numberofStars = 1 + Math.floor(Math.random()*9); | |
return ( | |
<div className="col-5"> | |
{_.range(props.numberofStars).map(i => | |
<i key={i} className="fa fa-star"></i> | |
)} | |
</div> | |
); |
View Pluralsight React.js: Github Card Component
const Card = (props) => { | |
return ( | |
<div style={{margin: '1em'}}> | |
<img width="75" src={props.avatar_url} /> | |
<div style={{display: 'inline-block', marginLeft: 10}}> | |
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>{props.name}</div> | |
<div>{props.company}</div> | |
</div> | |
</div> | |
); |
View Pluralsight React.js: Getting Started: Your First Component
class Button extends React.Component { | |
handleClick = () => { | |
this.props.onClickFunction(this.props.incrementValue); | |
}; | |
render() { | |
return ( | |
<button onClick={this.handleClick}> | |
+{this.props.incrementValue} | |
</button> |
View KATA: Square(n)Sum
function squareSum(numbers){ | |
var total = 0; | |
for(var i = 0; i < numbers.length; i++) { | |
total += numbers[i] * numbers[i]; | |
} | |
return total; |
View KATA: Do I get a bonus?
function bonusTime(salary, bonus) { | |
if(bonus === true){ | |
return '£' + salary * 10; | |
} else { | |
return '£' + salary; | |
} | |
} |
View KATA: Basic Mathematical Operations
function basicOp(operation, value1, value2) | |
{ | |
if (operation === '+') { | |
return value1 + value2; | |
} else if(operation === '-') { | |
return value1 - value2; | |
} else if(operation === '*') { | |
return value1 * value2; | |
} else if(operation === '/'){ | |
return value1/value2; |
View KATA: My Head is at the Wrong End!
function fixTheMeerkat(arr) { | |
var end = arr.shift(); | |
var begin = arr.pop(); | |
arr.push(end); | |
arr.unshift(begin); | |
return arr; | |
} |
NewerOlder