Skip to content

Instantly share code, notes, and snippets.

View tabuna's full-sized avatar

Alexandr Chernyaev tabuna

View GitHub Profile
@tabuna
tabuna / Git download
Last active July 20, 2017 13:41
Git download
wget -r -np https://www.exemple.com/.git/
find . -type f -name "*.html*" -exec rm -f {} \;
git status
git checkout -- .
@tabuna
tabuna / Image optimize
Created March 17, 2017 07:32
Image optimize
find -type f -name "*.jpg" -exec jpegoptim --strip-all -pm85 --all-progressive -t {} \;
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>@yield('title','Последние записи') - {{setting('site_title')}}</title>
<meta name="description" content="{{setting('site_description')}}">
<meta name="keywords" content="{{setting('site_keywords')}}">
<?php namespace App\Http\Widgets;
use Orchid\Widget\Service\Widget;
use Orchid\Core\Models\Menu;
class MenuWidget extends Widget {
/**
* @return mixed
*/
@tabuna
tabuna / menu.blade.php
Created June 3, 2017 20:07
menu.blade.php
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
@foreach($menu as $item)
<li>
<a href="{{$item->slug}}"
title="{{$item->title}}"
target="{{$item->target}}"
rel="{{$item->robot}}"
@tabuna
tabuna / Blog.php
Created June 3, 2017 20:22
Blog.php
<?php
namespace App\Core\Behaviors\Many;
use Orchid\Behaviors\Many;
use Orchid\Http\Forms\Posts\BasePostForm;
use Orchid\Http\Forms\Posts\UploadPostForm;
class Blog extends Many
{
@tabuna
tabuna / BlogController.php
Created June 3, 2017 20:33
BlogController.php
<?php
namespace App\Http\Controllers;
use Orchid\Core\Models\Post;
class BlogController extends Controller
{
/**
@tabuna
tabuna / post.blade.php
Last active June 3, 2017 20:40
post.blade.php
@extends('layouts.app')
@section('title',$post->getContent('title'))
@section('keywords',$post->getContent('keywords'))
@section('description',$post->getContent('description'))
@section('content')
@tabuna
tabuna / main.blade.php
Created June 3, 2017 20:41
main.blade.php
@extends('layouts.app')
@section('content')
<!-- Page Header -->
<!-- Set your background image for this header on the line below. -->
<header class="intro-header" style="background-image: url('img/home-bg.jpg')">
<div class="container">
<div class="row">
@tabuna
tabuna / parse.php
Created July 20, 2017 13:43
Top 1M
<?php
require 'vendor/autoload.php';
$top = fopen('./top-1m.csv','r');
$client = new GuzzleHttp\Client();
while ( ($data = fgetcsv($top) ) !== FALSE ) {
$sitename = $data[1]; // google.com