Skip to content

Instantly share code, notes, and snippets.

View mnabialek's full-sized avatar
🖥️
Coding, coding, coding...

Marcin Nabiałek mnabialek

🖥️
Coding, coding, coding...
View GitHub Profile
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
@mnabialek
mnabialek / HasFilters.php
Created March 16, 2020 08:21 — forked from nkeena/HasFilters.php
A simple trait that provides robust filtering by a model's attributes
<?php
namespace App\Traits;
use Illuminate\Support\Str;
trait HasFilters
{
public function scopeFilter($query, $filters = [])
{
@mnabialek
mnabialek / macos_mojave_homebrew_apache_php_mariadb_2018.md
Created September 29, 2018 08:51 — forked from karlhillx/macos_mojave_homebrew_apache_php_mariadb_2019.md
macOS Mojave Setup: Homebrew + Apache + PHP + MariaDB

macOS Mojave Setup: Homebrew + Apache + PHP + MariaDB

Homebrew Logo

Homebrew Installation

Homebrew is an excellent package manager for macOS, let's install it.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
vagrant@homestead:~/$ /etc/init.d/memcached status
* memcached is not running
vagrant@homestead:~/$ sudo /etc/init.d/memcached start
* Starting memcached: memcached.
@mnabialek
mnabialek / laravel.assets.copy
Created August 15, 2014 09:13
How to copy assets in Laravel into public directory (as example Twitter Bootstrap assets)
php artisan asset:publish --path="vendor\twbs\bootstrap-sass\assets" .
@mnabialek
mnabialek / bootstrap-sass-composer
Last active August 29, 2015 14:05
How to add Bootstrap Sass into composer.json
"require": {
"laravel/framework": "4.2.*",
"twbs/bootstrap-sass": "3.2.*" // line to add Twitter Bootstrap Sass
},