Skip to content

Instantly share code, notes, and snippets.

🏠
Working from own office

Sinan Eldem sineld

🏠
Working from own office
Block or report user

Report or block sineld

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active Sep 20, 2019
Destroy all Docker Containers and Images
View docker-destroy-all.sh
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@poul-kg
poul-kg / valet.conf
Last active Sep 19, 2019
CORS Rules for Laravel Valet Nginx
View valet.conf
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created Feb 27, 2017 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
View LC_CTYPE.txt
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@brandonaaskov
brandonaaskov / jQuery Change Event: Proper Binding
Created Jan 11, 2012
jQuery's change() event doesn't work as expected with input text fields. This, however, does work.
View jQuery Change Event: Proper Binding
/*
For some reason, the change() event only fires when the input field loses focus.
Binding to other options ('change keypress paste focus textInput input') will
fire the event several times, which is bad. The below code works even when
content is pasted into the text field, and only fires once as expected.
*/
$('#search-form .term').bind('input', function(){
console.log('this actually works');
});
@tobysteward
tobysteward / BlogController.php
Last active Sep 16, 2019
Laravel AJAX Pagination with JQuery
View BlogController.php
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@Michael-Brooks
Michael-Brooks / passwordValidation.php
Last active Sep 16, 2019
Laravel Password validation Regex (Contain at least one uppercase/lowercase letters and one number)
View passwordValidation.php
<?php
/*
* Place this with the rest of your rules.
* Doesn't need to be in an array as there are no pipes.
* Password is required with a minimum of 6 characters
* Should have at least 1 lowercase AND 1 uppercase AND 1 number
*/
$rules = [
'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/'
];
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active Sep 13, 2019
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)
View _verify-repair-permissions-disk.md

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@ziadoz
ziadoz / awesome-php.md
Last active Sep 13, 2019
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
View awesome-php.md
@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);
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active Aug 28, 2019
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
You can’t perform that action at this time.