Skip to content

Instantly share code, notes, and snippets.

View olegafx's full-sized avatar
😎
Every day I'm shuffling

Oleg Kislitsyn olegafx

😎
Every day I'm shuffling
View GitHub Profile
@olegafx
olegafx / gear.md
Last active August 29, 2015 14:14 — forked from joelhooks/gear.md
@olegafx
olegafx / jquery_to_plain_js.js
Created June 10, 2014 03:39
Some jQuery methods written in plain JavaScript.
// -----------------------------Listening for Document Ready-----------------------------
// Add an event listener of DOMContentLoaded to the whole document and call an anonymous function.
// You can then wrap your code in that function's brackets
// and it will execute once loading is complete.
document.addEventListener('DOMContentLoaded', function () {
// Our hawaiian greeting is displayed as soon as the page loads,
@olegafx
olegafx / git_commands.sh
Last active January 24, 2021 10:57
Useful git commands
# Save branch history and revert easily
git merge --no-ff
git revert -m 1 <hash>
# Show n lines of context around diff lines instead of the usual +/- 3
git diff -U<n>
# Check which branches are merged
git branch --merged
<?php
/**
* DuplicateFilter prevents Yii from exposing URLs starting with /index.php/ when showScriptName is false. Such
* URLs are automatically redirected to proper ones.
*
* To use add the following to your controller:
*
* ```php
* public function filters() {
* return array(
@olegafx
olegafx / Terminal_commands.sh
Last active February 14, 2018 10:36
Useful bash commands
# Replace all `arg1` with `arg2` in previous command
!!:gs/arg1/arg2
# Emulate brew cask upgrade https://github.com/phinze/homebrew-cask/issues/309#issuecomment-36743989
brew update
for c in `brew cask list`; do ! brew cask info $c | grep -qF "Not installed" || brew cask install $c; done
# Set network speed
sudo ipfw pipe 1 config bw 56Kbit/s delay 200 plr 0.2