// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ----------- | |
// Debugger that shows view port size. Helps when making responsive designs. | |
// ----------- | |
function showViewPortSize(display) { | |
if(display) { | |
var height = window.innerHeight; | |
var width = window.innerWidth; | |
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;bottom:0px;left:0px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>'); | |
jQuery(window).resize(function() { | |
height = window.innerHeight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* smartphones, touchscreens */ | |
@media (hover: none) and (pointer: coarse) { | |
/* ... */ | |
} | |
/* stylus-based screens */ | |
@media (hover: none) and (pointer: fine) { | |
/* ... */ | |
} |
- pwd - aktualny katalog
- ls -la - listuje wszystkie dostępne pliki
- ls -lat - listuje wszystkie dostępne pliki posortowane według czasu modyfikacji
- cp -r {nazwa pliku/katalogu} {miejsce docelowe} - kopiuje plik lub cały katalog z zawartością we wskazane miejsce
- mv {nazwa pliku/katalogu} {miejsce docelowe} - przenosi plik lub cały katalog z zawartością we wskazane miejsce (jeśli lokalizacja pliku docelowego jest taka sama jak pliku do przeniesienia, zmienia nazwę)
- du -sh - pokazuje zajętość całego katalogu
- du -sh * - pokazuje rozmiar poszczególnych plików i katalogów
- git init - inicjalizuje repozytorium GIT w katalogu
- git clone {adres repozytorium} - klonuje repozytorium do katalogu
- git status - pokazuje status repozytorium (pokazuje informację o zmodyfikowanych, nowych, usuniętych oraz nie należące do repozytorium plikach)
- git remote add {jakaś nazwa} {adres repozytorium} - dodaje repozytorium innego użytkownika (
git remote add upstream https://github.com/bluetree-service/idylla.git
) - git remote -v lista wszystkich zewnetrznych repozytoriów
- git remote rm {nazwa dla remota} - usuwa zewnętrzne repozytorium
- git fetch {nazwa remota} - pobiera listę zmian z innego repozytorium (w tym pokazuje nowe gałęzie)
- git branch - lista gałęzi w repozytorium
Check outdated npm packages:
- npm outdated
Install npm-check-updates and update all npm packages:
- npm i -g npm-check-updates && ncu -u && npm i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[href^=#]:not([href=#])').on('click', function () { | |
var element = $($(this).attr('href')); | |
$('html,body').animate({ scrollTop: element.offset().top },'normal', 'swing'); | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function handleProperDevice(x) { | |
if (x.matches) { | |
// If media query matches | |
} else { | |
// If media query doesn't match | |
} | |
} | |
var x = window.matchMedia("(max-width: 768px)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Redirect output to stderr. | |
exec 1>&2 | |
# enable user input | |
exec < /dev/tty | |
consoleregexp='console' | |
# CHECK | |
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0 | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
debug_rex='/console.log/' | |
debug_print_rex=$debug_rex'p' | |
debug_del_rex=$debug_rex' d' | |
add_debug_patch='.add-debug.patch' | |
del_debug_patch='.del-debug.patch' | |
git_work_dir="$(git rev-parse --show-toplevel)" | |
fake_file="$git_work_dir/.fake_file" | |
cur_dir="$(pwd)" |
OlderNewer