Skip to content

Instantly share code, notes, and snippets.

View sineld's full-sized avatar
🏢
Full Stack Developer

Sinan Eldem sineld

🏢
Full Stack Developer
View GitHub Profile
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@stidges
stidges / AllowedUsernameValidator.php
Created March 10, 2017 18:21
Code to accompany the 'Writing an Allowed Username Validator in Laravel' (http://blog.stidges.com/post/writing-an-allowed-username-validator-in-laravel)
<?php
# app/Validation/AllowedUsernameValidator.php
namespace App\Validation;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Routing\Router;
use Illuminate\Config\Repository;
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@santigarcor
santigarcor / Laravel PHP7 LEMP AWS.md
Last active June 15, 2018 03:34 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#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 July 20, 2016 14:31
Laravel Paginate Collection or Array
<?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 February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#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
@lopspower
lopspower / README.md
Last active April 17, 2024 23:43
All InputType for EditText

All InputType for EditText

Twitter

Constant Description
none There is no content type. The text is not editable.
@TahaSh
TahaSh / ajax-validation-with-vue.js
Created January 16, 2016 14:36
Ajax validation with VueJS
new Vue({
el: '#app',
data: {
formInputs: {},
formErrors: {}
},
methods: {
submitForm: function(e) {
#!/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 February 13, 2024 12:40
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
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.