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
(() => { | |
const range = (num) => { | |
return [...Array(num).keys()].map(n => n+1) | |
} | |
const productEqualsSum = (a, b, number) => { | |
const sum = ((number * (number+1)) / 2) - (a+b); | |
return a*b === sum; | |
} |
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 PasswordValidator = function () { | |
var errors = []; | |
return { | |
errors: errors, | |
validateLength: function(password) { | |
if (password.length < 6) { | |
errors.push('The password must be at least 6 characters long.') | |
} | |
}, |
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 scopeByInStore($query) | |
{ | |
$inStoreOrderType = GiftCardOrderTypes::$inStore; | |
$id = GiftCardBatch::where('name', '=', $inStoreOrderType)->first()->id; | |
$inStoreGiftCardIds = GiftCard::where('gift_card_batch_id', '=', $id) | |
->lists('id'); | |
return $query->whereIn('gift_card_id', $inStoreGiftCardIds); | |
} |
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 scopeByInStore($query) | |
{ | |
return GiftCardTransaction::whereHas('GiftCard', function ($query) | |
{ | |
$query->whereHas('GiftCardBatch', function ($query) | |
{ | |
$inStoreOrderType = GiftCardOrderTypes::$inStore; | |
$id = GiftCardBatch::where('name', '=', $inStoreOrderType)->first()->id; | |
$query->where('id', $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
# TYPE DATABASE USER ADDRESS METHOD | |
# "local" is for Unix domain socket connections only | |
local all all peer | |
# IPv4 local connections: | |
host all all 127.0.0.1/32 ident | |
# IPv6 local connections: | |
host all all ::1/128 ident | |
# Allow replication connections from localhost, by a user with the | |
# replication privilege. |
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
'use strict'; | |
var DomService = function (ng) { | |
return { | |
get: function(selector) { | |
return ng.element(selector); | |
} | |
}; | |
}; |
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 gulp = require('gulp'), | |
notify = require('gulp-notify'), | |
phpspec = require('gulp-phpspec'), | |
browserify = require('gulp-browserify'), | |
sass = require('gulp-sass'), | |
compass = require('gulp-compass'); | |
gulp.task('phpspec', function() { | |
var options = {notify: false}; | |
gulp.src('app/spec/**/*.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
<div class="angular-container" ng-controller="foodItemsCtrl"> | |
<table class="table table-striped"> | |
<tr> | |
<th>Name</th> | |
<th>Description</th> | |
<th>Starts At</th> | |
<th>Ends At</th> | |
<th>Price</th> | |
<th>Cooking Instructions</th> |
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
'use strict'; | |
var FoodItemService = function($http) { | |
return { | |
get : function() { | |
return $http.get('/api/food_item_templates'); | |
}, | |
test : function() { |
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 add_ingredient() | |
{ | |
if (Session::token() !== Input::get('_token')) | |
{ | |
return Response::json(array( | |
'msg' => 'Unauthorized attempt to create option' | |
)); |