Skip to content

Instantly share code, notes, and snippets.

View emmanuelbarturen's full-sized avatar
🌱
Give me an challenge

Emmanuel Barturen emmanuelbarturen

🌱
Give me an challenge
View GitHub Profile
@emmanuelbarturen
emmanuelbarturen / System Design.md
Created November 12, 2022 03:00 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@emmanuelbarturen
emmanuelbarturen / hosts
Created April 22, 2021 16:46 — forked from lanlee212/hosts
Hosts
#Social Networking Websites Blocker
#Updated 01/01/2012 (dd/mm/yyyy)
#Opensource project by WingAdmiral from Sourceforge
127.0.0.1 localhost
::1 localhost
#Web Addresses that will be blocked
@emmanuelbarturen
emmanuelbarturen / cashier.php
Created November 5, 2020 01:32 — forked from Braunson/cashier.php
Extending the Laravel package Cashier for creating an customer without a credit card
namespace Acme\V1\Billing;
// BillableInterface.php
use Laravel\Cashier\BillableInterface as CashierInterface;
interface BillableInterface extends CashierInterface {
}
@emmanuelbarturen
emmanuelbarturen / app.js
Last active September 10, 2020 16:01
Api Calls Queue with Vuejs 2
const app = new Vue({
el: '#tool-app',
data() {
return {
tivs: [],
nextKey: 0
}
},
mounted() {
API.getAllTIV().then(response => {
@emmanuelbarturen
emmanuelbarturen / create_package_for_laravel.md
Last active August 17, 2022 20:01
Build a laravel package on laravel homestead

Directory Structure

code 
└───dev-packages
│   │
|   └─── <vendor-name>
│   │   |
|   |   └─── <package-name>
│   │   |   | README.md
@emmanuelbarturen
emmanuelbarturen / auto-validator-laravue.js
Created April 8, 2019 16:35
Show error validation from laravel to vue
import Vue from "vue";
/**
* Created by emman <emmanuelbarturen@gmail.com> on 21-Aug-18.
*/
Vue.prototype.$setErrorsFromResponse = function(errorResponse) {
// only allow this function to be run if the validator exists
if(!this.hasOwnProperty('$validator')) {
return;
}
@emmanuelbarturen
emmanuelbarturen / app.js
Last active August 9, 2018 17:31
Custom filters for Vuejs 2
// For add to vuejs
import {truncate,padZeros} from './customFilters';
Vue.filter('truncate', truncate);
Vue.filter('padZeros', padZeros);
@emmanuelbarturen
emmanuelbarturen / checkElementsOverflow.js
Created June 5, 2018 00:14
Check clases that generate horizontal scroll
# Only copy-paste in console the follow
var docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
console.log(el);
}
}
@emmanuelbarturen
emmanuelbarturen / command.txt
Created April 4, 2018 21:20
Clone database in ubuntu
$ mysqldump -u <user name> --password=<pwd> <original db> | mysql -u <user name> -p <new db>
@emmanuelbarturen
emmanuelbarturen / StarRating.vue
Created February 26, 2018 00:42
component for rating, accept decimals
<template>
<div>
<i class="fa fa-star" aria-hidden="true" v-for="i in completeStarts(rating)"></i>
<i class="fa fa-star-half-o" aria-hidden="true" v-if="haveHalfStart(rating)"></i>
<i class="fa fa-star-o" aria-hidden="true" v-for="x in incompleteStarts(rating)"></i>
</div>
</template>
<script>
export default {
name: 'StarRating',