Skip to content

Instantly share code, notes, and snippets.

🏠
Working from own office

Sinan Eldem sineld

🏠
Working from own office
View GitHub Profile
@santigarcor
santigarcor / Laravel PHP7 LEMP AWS.md
Last active Jun 15, 2018 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x
View Laravel PHP7 LEMP AWS.md

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@vluzrmos
vluzrmos / paginate.php
Created Jul 20, 2016
Laravel Paginate Collection or Array
View paginate.php
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active Jun 24, 2020
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x
View Laravel PHP7 LEMP AWS.md

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@TahaSh
TahaSh / ajax-validation-with-vue.js
Created Jan 16, 2016
Ajax validation with VueJS
View ajax-validation-with-vue.js
new Vue({
el: '#app',
data: {
formInputs: {},
formErrors: {}
},
methods: {
submitForm: function(e) {
View batch_image_resize.sh
#!/bin/bash
# This script resizes all the images it finds in a folder (and its subfolders) and resizes them
# The resized image is placed in the /resized folder which will reside in the same directory as the image
#
# Usage: > ./batch_resize.sh
initial_folder="/your/images/folder" # You can use "." to target the folder in which you are running the script for example
resized_folder_name="resized"
all_images=$(find -E $initial_folder -iregex ".*\.(jpg|gif|png|jpeg)")
@ivanvermeyen
ivanvermeyen / EnsureQueueListenerIsRunning.php
Last active Jun 24, 2020
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
View EnsureQueueListenerIsRunning.php
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
@pupadupa
pupadupa / Lravel-5-inpalce-edit-using-xeditable.php
Last active May 18, 2020
Laravel 5 inplace editing using jquery's x-editable plugin . Inline and bulk editing examples.
View Lravel-5-inpalce-edit-using-xeditable.php
/**
*
* In this example we create view with inplace and bulk editing.
* Tools and plugins:
* jQuery
* xEditable jquery plugin
* twitter bootstrap
*
*/
@scottoffen
scottoffen / add-datatables.js
Last active Nov 19, 2016
Apply the DataTables jQuery plugin to any table on a website
View add-datatables.js
var options = { class : "wikitable", idx : 0, id : "firstWikiTable" };
var dt_options = { paging: false, scrollY: 400 };
var jscript = document.createElement("script"); jscript.src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"; document.body.appendChild(jscript);
jscript.onload = function ()
{
var script = document.createElement("script"); script.src="https://cdn.datatables.net/1.10.6/js/jquery.dataTables.min.js"; document.body.appendChild(script);
script.onload = function ()
{
var css = document.createElement("link"); css.rel="stylesheet"; css.href="https://cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css"; document.body.appendChild(css);
css.onload = function ()
@sineld
sineld / paginator.js
Last active Apr 17, 2016 — forked from kirkbushell/paginator.js
Paginator module for AngularJS, in combination with Laravel's paginator class
View paginator.js
/**
* Paginator
*
* The paginator can be used within any controller to easily set up
* some pagination options, including number of pages, page navigation
* and more. It is built to work with Laravel's own pagination library,
* which returns data in a particular format.
*
* Usage:
* Before you can use paginator, make sure you specify the URLs to your pagination
@tobikris
tobikris / gist:2d709777024b7bc40370
Created Jun 25, 2015
Artisan Command Progressbar
View gist:2d709777024b7bc40370
<?php
$progressBar = $this->output->createProgressBar(count($users));
$progressBar->setEmptyBarCharacter(' ');
$progressBar->setProgressCharacter('>');
$progressBar->setBarCharacter('-');
$progressBar->start();
foreach ($users as $user) {
$this->performTask($user);
You can’t perform that action at this time.