Skip to content

Instantly share code, notes, and snippets.

View soyFelixBarros's full-sized avatar
🏠
Working from home

Felix Barros soyFelixBarros

🏠
Working from home
View GitHub Profile
@vosidiy
vosidiy / basic.html
Last active September 2, 2020 18:15
Basic hover navbar
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main_nav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="main_nav">
<ul class="navbar-nav">
<li class="nav-item active"> <a class="nav-link" href="#">Home </a> </li>
<li class="nav-item"><a class="nav-link" href="#"> About </a></li>
<li class="nav-item"><a class="nav-link" href="#"> Services </a></li>
@nicoavila
nicoavila / docker-compose.yml
Last active March 7, 2024 12:30
Docker Compose file for a MySQL 5.7 container
version: '3.3'
services:
database:
image: mysql:5.7
container_name: mysql
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
// Add this to the "boot()" method of your "AppServiceProvider"
<?php
\Illuminate\Database\Eloquent\Builder::macro('search', function ($name, $search) {
return $this->where($name, 'LIKE', $search ? '%'.$search.'%' : '');
});
@Tucker-Eric
Tucker-Eric / generate.sh
Created February 16, 2017 18:06
Script to generate nginx config
SED=`which sed`
CURRENT_DIR=`dirname $0`
echo "What is the domain?"
read DOMAIN
# check the domain is valid!
PATTERN="^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$";
if [[ "$DOMAIN" =~ $PATTERN ]]; then
DOMAIN=`echo $DOMAIN | tr '[A-Z]' '[a-z]'`
@carlodaniele
carlodaniele / custom-queries.php
Last active January 23, 2024 01:35
An example plugin showing how to add custom query vars, rewrite tags and rewrite rules to WordPress
<?php
/**
* @package Custom_queries
* @version 1.0
*/
/*
Plugin Name: Custom queries
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@sid24rane
sid24rane / udp.js
Created July 25, 2016 08:39
Simple UDP Client and Server in Node.js ==> ( Echo Server )
var udp = require('dgram');
// --------------------creating a udp server --------------------
// creating a udp server
var server = udp.createSocket('udp4');
// emits when any error occurs
server.on('error',function(error){
console.log('Error: ' + error);
@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
@junkystu
junkystu / laravel-forge-deployment-script.sh
Last active May 23, 2021 05:18
Script for quicker deployment with Laravel and Forge
# The idea of this deployment script is to create a deploy copy of your website and handle
# Git and Composer updates in there. Aferwards, it just renames that deploy copy to become the
# live website. We then run the database migrations and take the application out of maintenance mode.
# Obviously, you will have to replace all instances of {{ websiteName }} with the name of your website and
# {{ branchName }} with the name of the branch you would like to pull changes from. This is usually the master branch.
# Start by checking for for old deployment folder and remove it if we have one.
if [ -d "/home/forge/{{ websiteName }}-deploy" ]; then
rm -Rf /home/forge/{{ websiteName }}-deploy
@adrianalonso
adrianalonso / ImportCountriesCommand.php
Created January 22, 2016 12:10
Symfony Command Import CSV
<?php
namespace AppBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP