Skip to content

Instantly share code, notes, and snippets.

View jcricaro's full-sized avatar

JC Ricaro jcricaro

  • Mithiin Solutions
View GitHub Profile
<?php
trait Mappable {
/**
* @param \Symfony\Component\HttpFoundation\ParameterBag $json
* @return FormRequest|void
*/
public function setJson($json)
{
foreach($this->map as $original => $new) {
@jcricaro
jcricaro / modules.js
Created July 26, 2019 07:28
Vuex Module Registration
import camelCase from 'lodash/camelCase'
const requireModule = require.context('.', false, /\.js$/)
const modules = {}
requireModule.keys().forEach(fileName => {
if(fileName === './index.js') return
const moduleName = camelCase(
fileName.replace(/(\.\/|\.js)/g, '')
)
@jcricaro
jcricaro / _globals.js
Created July 26, 2019 07:22
Component Registration
import Vue from 'vuex'
import upperFirst from 'lodash/upperFirst'
import camelCase from 'lodash/camelCase'
const requireComponent = require.context(
'.', false, /base-[\w-]+\.vue$/
)
requireComponent.keys().forEach(filename => {
const componentConfig = requireComponent(filename)
@jcricaro
jcricaro / watcher.vue
Created July 26, 2019 07:17
Smarter Watchers
// watchers can have texts instead of functions
watch: {
searchText: 'fetchUserList'
}
// no need for created() this.fetchUserList()
watch: {
searchText: {
handler: 'fetchUserList',
immediate: true
for(var column in this.sharedState.data.columns) {
if(event.target.attributes.column.value !== column) {
if(this.sharedState.data.columns[column].column == event.target.value) {
this.sharedState.data.columns[column].column = null
}
}
}
```
[2017-04-04 15:03:35] local.INFO: fdsf [{"iss":"DTApi","sub":"111222333","iat":1491311015,"exp":1522847015},"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJEVEFwaSIsInN1YiI6IjExMTIyMjMzMyIsImlhdCI6MTQ5MTMxMTAxNSwiZXhwIjoxNTIyODQ3MDE1fQ.35F07FnvrSnmqrYsuk3GoHbScYCGyilc9b7G7I9_YgA","[object] (DTApi\\Models\\Application: {\"id\":1,\"name\":\"DTWeb\",\"key\":\"111222333\",\"secret\":\"aaabbbccc\",\"is_active\":1,\"created_at\":null,\"updated_at\":null})"]
[2017-04-04 15:03:35] local.ERROR: Illuminate\Contracts\Encryption\DecryptException: The MAC is invalid. in /Users/enigma/Web/dtolk-api/www/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:184
Stack trace:
#0 /Users/enigma/Web/dtolk-api/www/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php(123): Illuminate\Encryption\Encrypter->getJsonPayload(Array)
#1 /Users/enigma/Web/dtolk-api/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\Encryption\Encrypter->decrypt('eyJpdiI6ImdHeVF...')
#2 /User
{
"attributes" : [
{
"name" : "color",
"values" : [
"white",
"black"
]
},
{
REST
/me/reports/:id/comments
/me/projects/:id/reports
/me/projects
- [x] (admin/mobile) cms for l2aundry tips
- [ ] (admin) user banning if not cancelled
- [ ] (mobile) receipt
- [x] (admin) validation reserve date (within the week, 7am to 5pm)
- [x] (admin/mobile)detergent / fab-con (8 max)
- [x] (admin/mobile) fab con - unli
- [ ] (mobile) non-refundable message
- [ ] (mobile) multiple reservations
- [ ] (mobile) remove “confirmation” for paid reservations
- [ ] (admin/mobile) estimted time sa washer
if($provincial) {
//provincial
if($weight <= 1) {
return 120;
} elseif($weight <= 2) {
return 160;
} else {
return 160 + (ceil($weight - 2) * 60);
}
} else {