Skip to content

Instantly share code, notes, and snippets.

@adparadise
adparadise / typography2.css
Created July 27, 2012 20:09
Typography example 2
h1 {
font-size: 1.125em;
}
@adparadise
adparadise / background_images.css
Created July 27, 2012 20:10
Background Images example
.header {
background: url(headerImage.png);
}
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
.header {
background: url(headerImage-hires.png);
background-size: 50%;
}
@adparadise
adparadise / foreground_images.css
Created July 27, 2012 20:11
Foreground Images
img {
width: 100%;
height: auto;
}
@adparadise
adparadise / site_navigation1.css
Created July 27, 2012 20:13
Site Navigation example 1
ul.nav {
list-style-type: none;
}
ul.nav li {
width: 8em;
display: inline-block;
text-align: center;
}
@adparadise
adparadise / navigation2.css
Created July 27, 2012 20:14
Navigation Example 2
@media (max-width: 32em) {
ul.nav li {
display: list-item;
width: 100%;
}
}
@adparadise
adparadise / footer.css
Created July 27, 2012 20:15
Footer example
@adparadise
adparadise / debugging_tip.css
Created July 27, 2012 20:17
Media Query Debugging Tip
@media (max-width: 520px) {
.container:before { content: "max-width: 520px";}
}
@adparadise
adparadise / index.js
Created November 2, 2012 20:16
Basic Node WebServer
var http = require('http');
var localPort = 8090;
function server (httpRequest, httpResponse) {
httpResponse.setHeader("Content-Type", "text/html");
httpResponse.write("Hello World!");
httpResponse.end();
}
http.createServer(server).listen(localPort);
console.log("Ready for connections...");
@adparadise
adparadise / gist:4004074
Created November 2, 2012 20:17
Add a package dependency
npm install request -SB
@adparadise
adparadise / index.js
Created November 2, 2012 20:20
Basic Node Proxy
var http = require('http');
var request = require('request');
var remoteHost = "cantina.co";
var localPort = 8090;
function server (httpRequest, httpResponse) {
var remoteRequest, remoteURL;
console.log("piping: " + httpRequest.url);
remoteURL = "http://" + remoteHost + httpRequest.url;