Skip to content

Instantly share code, notes, and snippets.

View mtancoigne's full-sized avatar

Manuel Tancoigne mtancoigne

View GitHub Profile
@mtancoigne
mtancoigne / events.md
Created April 26, 2017 00:09
Test with diagram

CakePHP events timeline

Events timeline for standard CakePHP actions. These events were taken from the DebugKit's Timeline

Index, View

Core Processing (Derived from $_SERVER["REQUEST_TIME"])

  • Event: Controller.initialize (Cookbook)
  • Event: Controller.startup (Cookbook)
  • Controller action (view)
@mtancoigne
mtancoigne / App.vue
Created April 25, 2017 11:53
Hangman game
<template>
<div id="app">
<div v-if="!gagne && !perdu">
<h1>Le pendu avec les animaux</h1>
<pre class="mot">{{motADeviner}}</pre>
<div>
<button v-for="l in lettres"
@click="testeLettre(l)"
:disabled="testees.indexOf(l) > -1"
class="btn-lettre"
@mtancoigne
mtancoigne / create_react.sh
Last active October 30, 2016 17:36
Sets up a basic React project
#!/bin/bash -
#title :create_react.sh
#description :Small script to get started with React+webpack+babel.
# Inspired by this tutorial: https://www.codementor.io/reactjs/tutorial/beginner-guide-setup-reactjs-environment-npm-babel-6-webpack
#author :Manuel Tancoigne
#date :20161030
#version :1.0
#usage :./create_react.sh [<project_name>]
#notes :
#bash_version :4.3.42(1)-release
@mtancoigne
mtancoigne / main.c
Last active January 16, 2023 19:42
Essais de C - Bataille navale
/**
* BATAILLE NAVALE
* ---------------
*
* Author : Manuel Tancoigne
* Date : finished on 2016/09/20
* License : MIT
*
* Notes:
* ------
//Functions
// `current` API function returns the current step step
var current = function() {
return steps.indexOf(activeStep);
};
// `total` API function returns the number of steps present
var total = function() {
return steps.length;
@mtancoigne
mtancoigne / change.php
Last active November 5, 2015 19:30
Password check for password change in cakePHPx
<?php
// in Model/Entity/User.php
public function comparePassword($password)
{
return (new DefaultPasswordHasher)->check($password, $this->password);
}
// In user/<someview>.ctp
echo $this->Form->create($user, ['action' => 'update_password']);
echo $this->Form->input('current_password', ['type' => 'password', 'label' => __d('users', 'Current password')]);
@mtancoigne
mtancoigne / croogo-link-activation.php
Created January 11, 2015 00:01
Cant create all links with this...
@mtancoigne
mtancoigne / tmp_pluginActivation.php
Created December 13, 2014 14:19
PluginActivation simplification
<?php
/**
* Events Activation
*
* Activation class for Events plugin.
* This is optional, and is required only if you want to perform tasks when your plugin is activated/deactivated.
*/
class EventsActivation {
/**