Skip to content

Instantly share code, notes, and snippets.

View ricogoh's full-sized avatar

ricogoh ricogoh

  • Malaysia
View GitHub Profile
@ricogoh
ricogoh / .editorconfig
Last active August 22, 2019 10:24
Editor Configuration Setting
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
@ricogoh
ricogoh / index.html
Created November 10, 2017 11:07
Detecting idle time in JavaScript elegantly // source https://jsbin.com/burabos
<html>
<header>
<meta name="description" content="Detecting idle time in JavaScript elegantly">
</header>
<body id="app">
<div id="demo"></div>
<p id="coor"></p>
<script id="jsbin-javascript">
document.getElementById("app").onmousemove = function(e) {resetTime(e)};
document.getElementById("app").onkeypress = function(e) {resetTime(e)};
@ricogoh
ricogoh / .php_cs
Last active March 4, 2020 02:12
PHP Coding Standards Fixer setting for Laravel 5 on FriendsOfPHP/PHP-CS-Fixer 2.*
<?php
/**
* PHP Coding Standards Fixer setting for Laravel 5 on friendsofphp/php-cs-fixer 2.*
* Rules with psr1, psr2, phpdoc and some symfony rules.
* Rules only apply directory and sub-directory inside "app".
*
* Save script to .php_cs and place .php_cs file in the root of your Laravel project
*
* Requirement:
@ricogoh
ricogoh / EloquentFooRepository.php
Created May 25, 2017 09:36 — forked from thepsion5/EloquentFooRepository.php
Example implementation of a Eloquent-based repository that provides a fluent interface for sorting and pagination without exposing the underlying model API.
<?php
class EloquenFooRepository
{
/**
* The base eloquent model
* @var Eloquent
*/
protected $model;
@ricogoh
ricogoh / .php_cs
Last active June 21, 2017 03:58
PHP Coding Standards Fixer setting for Laravel 5 on FriendsOfPHP/PHP-CS-Fixer 1.*
<?php
/**
* PHP Coding Standards Fixer setting for Laravel 5 on FriendsOfPHP/PHP-CS-Fixer 1.*
* Rules with psr1, psr2, phpdoc and some symfony rules.
* Remove psr0.
* Rules only apply directory and sub-directory inside "app".
*
* Save script to .php_cs and place .php_cs file in the root of your Laravel project
*
{
"name": "babel-nodejs-setup",
"version": "1.0.0",
"description": "Babel nodejs setup",
"main": "dist/index.js",
"scripts": {
"start": "node bin/dev",
"clean": "rm -rf dist",
"build": "npm run clean && mkdir dist && babel server -s -d dist",
"production": "npm run build && node bin/production"
@ricogoh
ricogoh / index.html
Last active October 18, 2016 06:10
Tryout VueJS
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Tryout VueJS">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div id="app">
{{ message }}