Skip to content

Instantly share code, notes, and snippets.

@atma
atma / gradient.css
Created December 16, 2012 17:35
Full CSS3 Gradients including IE filters and old webkit
.el {
background-color: #000;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bbb', endColorstr='#000');
background-image: -webkit-gradient(linear, left top, left bottom, from(#bbb), to(#000));
background-image: -webkit-linear-gradient(top, #bbb, #000);
background-image: -moz-linear-gradient(top, #bbb, #000);
background-image: -ms-linear-gradient(top, #bbb, #000);
background-image: -o-linear-gradient(top, #bbb, #000);
background-image: linear-gradient(top, #bbb, #000);
}
@atma
atma / font-face.css
Created December 16, 2012 17:36
Custom @font-face typography syntax
@font-face {
font-family: 'MyFont';
src: url('myfont.eot');
src: url('myfont.eot?#iefix') format('embedded-opentype'),
url('myfont.woff') format('woff'),
url('myfont.ttf') format('truetype'),
url('myfont.svg#webfont') format('svg');
}
h1 {
@atma
atma / meta-responsive.html
Created December 16, 2012 17:37
HTML Meta Tags for Responsive Layouts
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
@atma
atma / embed-html5-media.html
Created December 16, 2012 17:38
HTML5 Embedded Media - Video & Audio
<video poster="images/preview.png" width="1280" height="720" controls="controls" preload="none">
<source src="media/video.mp4" type="video/mp4"></source>
<source src="media/video.webm" type="video/webm"></source>
<source src="media/video.ogg" type="video/ogg"></source>
</video>
<audio controls="controls" preload="none">
<source src="music.ogg" type="audio/ogg">
<source src="music.mp3" type="audio/mpeg">
</audio>
@atma
atma / sample-layout.html
Last active December 10, 2015 04:28
uploader sample call & layout
<div id="sample-uploader-container" class="well">
<span id="sample-uploader-upload" class="btn"><i class="icon-upload"></i> Select</span> or drop here
</div>
<div id="sample-uploader-fileslist"></div>
@atma
atma / count_files.sh
Created May 10, 2013 02:13
Count all the files in a directory and all it's subdirectories
for i in /*; do echo $i; find $i | wc -l; done
@atma
atma / UNMR_stack.sh
Created July 15, 2013 19:39
How to install the latest versions of node.js/mongodb/redis on Ubuntu
sudo apt-get install python-software-properties
# Node.js
sudo apt-get purge nodejs npm
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
# mongodb
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo touch /etc/apt/sources.list.d/10gen.list
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
@atma
atma / ufw_rules.sh
Last active February 25, 2018 20:20
Basic rules for securing ubuntu VPS with ufw
# default rule
sudo ufw default deny
# allow ssh
sudo ufw allow 22/tcp
# enable firewall
sudo ufw enable
# allow https?
@atma
atma / nginx.conf
Created August 18, 2013 16:45
Nginx + nodejs + socket.io websockets
# Add to nginx.conf http section
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@atma
atma / WPEmulator.lnk
Created September 3, 2013 16:39
How to start Windows Phone 8 Emulator without Visual Studio
"C:\Program Files (x86)\Microsoft XDE\8.0\XDE.exe" /vhd "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.vhd" /video "720x1280" /memsize 1024 /language 409 /creatediffdisk "%Temp%\dd.720x1280.1024.vhd" /fastShutdown