Skip to content

Instantly share code, notes, and snippets.

View ponich's full-sized avatar
🤡
be happy

Mykola Ponych ponich

🤡
be happy
View GitHub Profile
@ponich
ponich / Flat UI Colors.txt
Last active November 1, 2017 18:19
Flat UI Colors
https://flatuicolors.com/
TURQUOISE: #1abc9cp
EMERALD #2ecc71
PETER RIVER #3498db
AMETHYST #9b59b6
WET ASPHALT #34495e
GREEN SEA #16a085
NEPHRITIS #27ae60
BELIZE HOLE #2980b9
@ponich
ponich / toggle.html
Last active March 17, 2018 04:05
JQ & Bootstrap toggle content block by button
<a data-panel-to="#content" class="btn btn-default">Content</a>
<p id="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis culpa dignissimos eveniet ex exercitationem explicabo fugiat impedit neque nisi numquam. Consequuntur distinctio facere mollitia nihil non quas totam. Necessitatibus, quo?
</p>
@ponich
ponich / AppServiceProvider.php
Last active February 6, 2018 12:30
Sample register your console command from ServiceProvider, use autoload class
<?php
use Illuminate\Contracts\Console\Kernel;
use App\YouApp\Console\Kernel as AppKernel;
class AppServiceProvider extends ServiceProvider
{
// boot ...
// register
@ponich
ponich / helpers.php
Last active April 24, 2018 01:35
Laravel helpers
<?php
if (!function_exists('getSql')) {
/**
* Returns SQL with values in it
*
* @param $model
* @return mixed
*/
function getSql($model)
@ponich
ponich / new.py
Created May 10, 2018 23:20
sample new python file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
@ponich
ponich / php-helpers.php
Created May 23, 2018 14:37
Native helpers
<?php
if (!function_exists('array_get')) {
/**
* Get value from array by key
*
* @param array $array
* @param string $key
* @param mixed $default
* @return mixed
@ponich
ponich / dump_helper.php
Created May 23, 2018 14:51 — forked from accentinteractive/dump_helper.php
dump_helper: functions to dump variables to the screen, in a nicley formatted manner
<?php
/**
* Dump helper. Functions to dump variables to the screen, in a nicley formatted manner.
* @author Joost van Veen
* @version 1.0
*/
if (!function_exists('dump')) {
function dump ($var, $label = 'Dump', $echo = TRUE)
{
// Store dump in variable
@ponich
ponich / git-delete-tag.sh
Created May 23, 2018 18:23
Delete tag from remote git
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@ponich
ponich / laravel-new
Created June 21, 2018 00:53
Create new laravel application. Use composser command ``laravel new`` from official package
#!/bin/bash -
WWW=/var/www/
LARAVEL_PATH=${1}
DOMAIN=$(echo "$LARAVEL_PATH" | cut -d "/" -f1)
MYSQL_USER=dev
MYSQL_DB=$(echo $DOMAIN | sed 's/\./_/g')
project_root(){
eval cd "${LARAVEL_PATH}"
@ponich
ponich / global.conf
Created June 21, 2018 00:59
Apache single global config for domains, use vhost_alias mod
# a2enmod vhost_alias
<VirtualHost *:80>
ServerName .ponich.com
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
# SSL with wildcard
<IfModule mod_ssl.c>