Skip to content

Instantly share code, notes, and snippets.

View impeto's full-sized avatar

Alin Mazilu impeto

View GitHub Profile
@impeto
impeto / Star Rating Component For Laravel Spark.md
Last active May 18, 2018 18:45
A Star Rating Vue.js component for Laravel Spark (or any other Vue.js project, really)

The Vue component

Vue.component('star-component', {
    props: ['sparkForm'],

    data(){
        return {
            stars: 5,
            hover: 5
        };
//download ioncube
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
//blow it up
tar xvfz ioncube_loaders_lin_x86-64.tar.gz
//find the php extension dir
php -i | grep extension_dir
//put php version in a variable
@impeto
impeto / Array.chunk.js
Created January 31, 2016 16:25
Adds method `chunk` to the array class similar to Eloquent Collection's chunk method
(function() {
Array.prototype.chunk = function (chunkSize) {
var n = this.length;
if (chunkSize >= n) {
return [this];
}
if (n == 0) {
return [];
@impeto
impeto / encapsulation.php
Last active October 4, 2015 16:43
How getters solve encapsulation
<?php
calss Date {
public $date;
public function __construct( $date){
$this->date = $date;
}
//other methods