Skip to content

Instantly share code, notes, and snippets.

@JonathanDn
JonathanDn / component.vue
Last active June 20, 2023 15:54
Vue.js 2/3 - Vue.Observable - Simple Store Implementation, returning a reactive object.
// component importing and mutating state from store.js (all getters, mutations, actions)
// reference = https://austincooper.dev/2019/08/09/vue-observable-state-store/
<template>
<div>
<div>Radius: {{ radius }}</div>
<div>Color: {{ color }}</div>
<button @:click="setRadius(0)">Reset radius</button>
<button @:click="fetchColorFromApi">Fetch color</button>
</div>
</template>
@alexandrevilain
alexandrevilain / api.md
Last active April 21, 2024 16:54
Livebox API
@njxqlus
njxqlus / web.php
Last active June 6, 2021 11:59
Laravel Voyager + Laravel Passport Routes
<?php
Route::group(['prefix' => 'admin'], function ()
{
Voyager::routes();
Route::post('logout', ['uses' => 'Auth\LoginController@logout'])->name('voyager.logout');
Route::post('login', ['uses' => 'Auth\LoginController@login'])->name('voyager.postlogin');
Route::get('login', ['uses' => 'Auth\LoginController@showLoginForm'])->name('voyager.login');
});
@bramus
bramus / myservice
Created November 11, 2013 11:23
Running a PHP script as a service/daemon using `start-stop-daemon`
#! /bin/sh
# Installation
# - Move this to /etc/init.d/myservice
# - chmod +x this
#
# Starting and stopping
# - Start: `service myservice start` or `/etc/init.d/myservice start`
# - Stop: `service myservice stop` or `/etc/init.d/myservice stop`
@avalanche123
avalanche123 / timeout.php
Created July 10, 2012 19:12
timeouts in php
<?php
class TimeoutException extends RuntimeException {}
class Timeout
{
private $active;
public function set($seconds)
{
@lavoiesl
lavoiesl / apache-template
Created May 7, 2012 19:24
Apache VirtualHost Template with variable replacement
<VirtualHost *:80>
ServerAdmin {USER}@cslavoie.com
ServerName {DOMAIN}
ServerAlias www.{DOMAIN}
ServerAlias {USER}.localhost
ServerAlias {USER}.static.cslavoie.com
DocumentRoot {DOC_ROOT}
<Directory {DOC_ROOT}>