Skip to content

Instantly share code, notes, and snippets.

@fearrr
fearrr / .bash_aliases
Created July 22, 2018 13:49
.bash_aliases
#Навигация
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -ltrhA'
alias ..='cd ../'
alias ...='cd ../..'
alias lg='ls|grep --color'
#Терминал
alias c='clear'
@fearrr
fearrr / phone_regexp.md
Last active April 20, 2024 10:21
Регулярное выражение для мобильных и городских номеров России и СНГ

Регулярное выражение для мобильных и городских номеров России и СНГ

Страны:

  • Армения (+374),
  • Азербайджан (+994)
  • Грузия (+995)
  • Беларусь (+375)
  • Россия/Казахстан (+7)
  • Украина (+380, +38)
$colors: (
$gray gray,
$gray-light gray-light,
$gray-lighter gray-lighter,
$gray-dark gray-dark,
$gray-darker gray-darker,
$gray-base gray-base
);
@mixin generate-colors() {
<?php
/**
* @param $items //Принимает коллекцию или массив
* @param $page //Принимает $request->page
* @param $perPage //Принимает кол-во элементов на странице
* @param $url //Принимает $request->url()
* @param $query //Принимает $request->query()
* @return LengthAwarePaginator //Возвращает объект Paginator
*/
<?php
$input = [1,2,3,4,5,6,7,8];
$listing = Category::where('type', '=', 1)->where(function ($query) use ($input){
foreach ($input as $value) {
$query->orWhere('id', '=', $value);
}
});
<?php
public function up()
{
Schema::create('categories', function (Blueprint $table){
$table->increments('id');
$table->string('slug')->nullable();
$table->string('old_redirect')->nullable();
$table->string('name')->nullable();
require('../../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/transition.js');
// require('../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/alert.js');
// require('../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/button.js');
// require('../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/carousel.js');
require('../../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/collapse.js');
// require('../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js');
require('../../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/modal.js');
//require('../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/tab.js');
// require('../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/affix.js');
// require('../../../node_modules/bootstrap-sass/assets/javascripts/bootstrap/scrollspy.js');
// Core variables and mixins
//@import "../../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables";
@import "../../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins";
//@import "buttons";
// Reset and dependencies
@import "../../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/normalize";
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
├──────────┼────┼──────┼───────┼─────────┼─────────┼────────┼─────┼───────────┼──────────┤
│ app │ 0 │ fork │ 0 │ stopped │ 7093 │ 0 │ 0% │ 0 B │ disabled │
│ app │ 3 │ fork │ 21180 │ online │ 0 │ 0s │ 0% │ 14.5 MB │ disabled │
│ bot │ 1 │ fork │ 0 │ stopped │ 28 │ 0 │ 0% │ 0 B │ disabled │
│ shop │ 2 │ fork │ 0 │ stopped │ 219 │ 0 │ 0% │ 0 B │ disabled │
└──────────┴────┴──────┴───────┴─────────┴─────────┴────────┴─────┴───────────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
root@gs:/home/csgf/bot# pm2 log 3
[TAILING] Tailing last 15 lines for [3] process (change the value with --lines option)
@fearrr
fearrr / jqScrollFollow.js
Created March 13, 2017 14:38
Плавная прокрутка объекта вместе со скроллом
var $scrollingDiv = $("#scrollingDiv");
$(window).scroll(function(){
var $sT = $(window).scrollTop();
$scrollingDiv
.stop()
.animate({"marginTop" : ($sT + 30) + "px"}, "slow");
});