Skip to content

Instantly share code, notes, and snippets.

View andidp's full-sized avatar

AndiDePe andidp

View GitHub Profile
@andidp
andidp / endpoint.js
Created January 23, 2020 06:26
Routing Email Template
app.get('/v1/email_templates/:lang', UPLOAD_CONFIG.common, (req, res) => {
if (req.auth !== false) {
emailTemplate.getEmailTemplates(req, response => logSentResponse(req, res, response));
}
});
app.get('/v1/email_templates/:name/:lang', UPLOAD_CONFIG.common, (req, res) => {
if (req.auth !== false) {
emailTemplate.getEmailTemplate(req, response => logSentResponse(req, res, response));
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Answer extends Model
{
/**
* Get the question that owns the answer.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Question extends Model
{
/**
* Get the answers for the blog post.
@andidp
andidp / AnswersTableSeeder.php
Created August 9, 2016 04:10
Answer Table Seeder
<?php
use Illuminate\Database\Seeder;
class AnswersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@andidp
andidp / QuestionsTableSeeder.php
Created August 9, 2016 04:08
Questions db seeder
<?php
use Illuminate\Database\Seeder;
class QuestionsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@andidp
andidp / questions_and_answers.txt
Created August 9, 2016 03:01
questions and answers tables
+------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| title | varchar(255) | NO | | NULL | |
| body | mediumtext | NO | | NULL | |
| created_at | timestamp | YES | | NULL | |
| updated_at | timestamp | YES | | NULL | |
+------------+------------------+------+-----+---------+----------------+
@andidp
andidp / questions_and_answers.php
Created August 9, 2016 02:47
laravel migration file for creating questions and answers tables
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateQuestionsAndAnswersTables extends Migration
{
/**
* Run the migrations.
*
@andidp
andidp / link_helper.php
Created June 14, 2015 22:54
LinkHelper Grab From book.cakephp.org
@andidp
andidp / call_helper_in_controller.php
Last active November 28, 2022 15:22
Call Helper Function for using it on Controller in Cakephp 3
<?php
namespace App\Controller;
use App\Controller\AppController;
// Use Link Helper Class
use App\View\Helper\LinkHelper;
/**
* ProductCategories Controller
@andidp
andidp / click_jquery.js
Created February 17, 2015 09:05
jquery click
<html>
<head>
<title>title</title>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script>
$(document).ready(function(){
$('#sel div a').click(function(){
console.log( this.rel );