Skip to content

Instantly share code, notes, and snippets.

@pavelbinar
pavelbinar / Media-Queries.css
Created February 4, 2014 14:50
Common CSS Media Queries Break Points
@media only screen and (min-width: 768px) {
/* tablets and desktop */
}
@media only screen and (max-width: 767px) {
/* phones */
}
@media only screen and (max-width: 767px) and (orientation: portrait) {
/* portrait phones */
@pavelbinar
pavelbinar / update.sh
Created February 18, 2014 14:49
apt-get update, dist-upgrade, autoremove, autoclean in a single sudo command source: https://stackoverflow.com/questions/3316677/apt-get-update-dist-upgrade-autoremove-autoclean-in-a-single-sudo-command
sudo sh -c "apt-get update;apt-get dist-upgrade;apt-get autoremove;apt-get autoclean"
zip -r archive.zip folder-to-archive/
@pavelbinar
pavelbinar / symlink.sh
Created February 20, 2014 19:32
create symlink under mac os x
@pavelbinar
pavelbinar / ip-detection.php
Created February 20, 2014 20:29
detect IP addres
<?
$ip = getenv('REMOTE_ADDR'); //~ get ip address
$ip = "&ip=".$ip."&"; //~ make it a flashable variable
echo $ip; //~ spit it out
?>
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@pavelbinar
pavelbinar / domain-redirection.sh
Created February 24, 2014 15:27
htaccess redirect non-www to www
# Enable mod rewrite and restart server
a2enmod rewrite
service apache2 restart
# Edit .htaccess file in domain root directory
RewriteEngine On
sudo apt-get install ncurses-term
nano ~/.bashrc
# add following line to .bashrc
export TERM=xterm-256color
source ~/.bashrc
myString = myString.replace(/\D/g,'');
@pavelbinar
pavelbinar / nodejs-fix.js
Created March 10, 2014 17:13
npm cache clear - is a common fix for node issues
npm cache clear