Skip to content

Instantly share code, notes, and snippets.

View tinker1987's full-sized avatar

Dmytro Paiareli tinker1987

View GitHub Profile
@tsabat
tsabat / zsh.md
Last active October 16, 2024 14:43
Getting oh-my-zsh to work in Ubuntu
@kartikshah
kartikshah / tail-color.sh
Created February 17, 2012 22:44
Color output of linux tail command
$tail -100f /var/log/applications/application.log | awk '
/INFO/ {print "\033[32m" $0 "\033[39m"}
/Exception/ {print "\033[31m" $0 "\033[39m"}
'

Set username
git config --global user.name "Your Name Here"

Set e-mail
git config --global user.email "[email protected]"

Clorize and make git output pretty
git config --global color.ui true

Creating a repository

@denji
denji / nginx-tuning.md
Last active November 5, 2024 10:10
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 18, 2024 11:51
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@morontt
morontt / Version20140321190821.php
Created March 21, 2014 17:14
Enable/Disable foreign_key_checks for MySQL in doctrine migrations
<?php
/**
* Created by PhpStorm.
* User: morontt
* Date: 21.03.14
* Time: 19:08
*/
namespace Application\Migrations;
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@corbanb
corbanb / JavaScript.sublime-build
Last active August 25, 2024 00:42
Sublime Text - Tools > Build System > New Build System
// Sublime Text - Build System for Javascript
{
"cmd": ["node", "$file"],
"selector": "source.js"
}
@taylorhughes
taylorhughes / user-agents.txt
Last active April 6, 2024 16:07
A list of iOS embedded webview User-Agents
SAFARI 10.0.1
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1
CHROME on 10.0.1
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.86 Mobile/14A403 Safari/601.1.46
FACEBOOK MESSENGER
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A403 [FBAN/MessengerForiOS;FBAV/87.0.0.24.69;FBBV/38293694;FBRV/0;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iPhone OS;FBSV/10.0.1;FBSS/2;FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5]
TWITTER FOR IPHONE
@wilensky
wilensky / git_sm_co.sh
Last active October 15, 2019 06:10
Script checkouts each submodule on a given branch if latter exists (or fallback branch is used) and pulls if behind
#!/usr/bin/env bash
fetch=$(git fetch);
if [ "$(git show-ref refs/remotes/origin/$1)" ]; then # Checking branch for existence on remote
co=$(git checkout "$1"); # Checkouting branch that we checked for existence above
else
defaultFb="master"; # Default fallback
fb=${2:-$defaultFb} # Resulting fallback
echo "- Branch $1 does not exist. Switching to ${fb}";