Skip to content

Instantly share code, notes, and snippets.

View kefzce's full-sized avatar

kefzce

View GitHub Profile
@kefzce
kefzce / pre-commit
Created September 20, 2018 19:52 — forked from fesor/pre-commit
php-cs-fixer pre-commit hook
#!/usr/bin/env bash
echo "php-cs-fixer pre commit hook start"
PHP_CS_FIXER="bin/php-cs-fixer"
PHP_CS_CONFIG=".php_cs"
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')
if [ -n "$CHANGED_FILES" ]; then
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES;
git add $CHANGED_FILES;
@kefzce
kefzce / logslaravel.sh
Created August 19, 2018 11:18 — forked from jakebathman/logslaravel.sh
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@kefzce
kefzce / ExamplePassportTest.php
Created February 12, 2018 08:53 — forked from archy-bold/ExamplePassportTest.php
Testing Passport Authenticated Controllers and Routes in Laravel
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExamplePassportTest extends \PassportTestCase
{
use DatabaseTransactions;
@kefzce
kefzce / lp_counters.py
Created November 3, 2017 03:23 — forked from devdazed/lp_counters.py
Simple Linear Probabilistic Counters
"""
Simple Linear Probabilistic Counters
Credit for idea goes to:
http://highscalability.com/blog/2012/4/5/big-data-counting-how-to-count-a-billion-distinct-objects-us.html
http://highlyscalable.wordpress.com/2012/05/01/probabilistic-structures-web-analytics-data-mining/
Installation:
pip install smhasher
pip install bitarray
@kefzce
kefzce / weather.sh
Created September 9, 2017 23:02 — forked from taylorotwell/weather.sh
Weather CLI
alias weather='curl -s wttr.in | sed -n "1,7p"'
1. Почему вы выбрали именно нашу компанию?
Вы идиот (ка), да? Я, как и все кандидаты до меня и после меня, направил резюме в десяток мест.
Где устроюсь быстрее и выгоднее — там и хорошо.
2. Как вы считаете, почему мы должны выбрать именно вас?
Вам работники вообще нужны? Ну вот он я. Работник.
Именно меня стоит выбрать хотя бы потому, что я явно умнее всех тех, кто заливал на эти вопросы стандартную чушь.
И умнее вас, между прочим, потому что я никогда таких дурацких вопросов бы не задал.
@kefzce
kefzce / git-deployment.md
Created July 5, 2017 05:55 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

Title Change password
URL /api/users/passwordChange
Method POST
Headers Authorization=Bearer token
Content-type: application/json
Params password=current password
newPassword=new password
Data Params example
{
"password": "password",
"newPassword": "pass"
}
Success Response example{"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyJ9"}