I'm not sure. I'm afraid we need to use ... Math.
/* style.scss */
#navbar {
width: 80%;
height: 23px;
ul { list-style-type: none; }
li {
float: left;
a { font-weight: bold; }
}
}
/* compiled style.css */
#navbar {
width: 80%;
height: 23px; }
#navbar ul {
list-style-type: none; }
#navbar li {
float: left; }
#navbar li a {
font-weight: bold; }
/* style.scss */
$main-color: #ce4dd6;
$style: solid;
#navbar {
border-bottom: {
color: $main-color;
style: $style;
}
}
a {
color: $main-color;
&:hover { border-bottom: $style 1px; }
}
/* compiled style.css */
#navbar {
border-bottom-color: #ce4dd6;
border-bottom-style: solid; }
a {
color: #ce4dd6; }
a:hover {
border-bottom: solid 1px; }
/* style.scss */
@mixin rounded-top {
$side: top;
$radius: 10px;
border-#{$side}-radius: $radius;
-moz-border-radius-#{$side}: $radius;
-webkit-border-#{$side}-radius: $radius;
}
#navbar li { @include rounded-top; }
#footer { @include rounded-top; }
/* compiled style.css */
#navbar li {
border-top-radius: 10px;
-moz-border-radius-top: 10px;
-webkit-border-top-radius: 10px; }
#footer {
border-top-radius: 10px;
-moz-border-radius-top: 10px;
-webkit-border-top-radius: 10px; }
Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
vendor
subfolder), not system-wide (cfr. PEAR)$ curl -s https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/bin/composer
OS X users beware: If you're using MAMP, make sure that the php
binary used is the one included with MAMP, and not the one shipped with OS X.
composer.json
in your project root to declare your dependencies in
{
"require": {
"swiftmailer/swiftmailer": "4.*"
}
}
composer install
to install the dependencies
vendor
subfoldercomposer.lock
filecomposer update
to see some more magicrequire_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
vendor
subfolder! Above that don't add that folder (along with composer.lock
) into version control!<?php
// Require autoloader
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp2.kahosl.be', 25);
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Lorem Ipsum')
->setFrom(array('johndoe@example.org' => 'John Doe'))
->setTo(array(
'blackhole@bram.us' => 'blackhole'
))
->setBody(strip_tags(file_get_contents('assets/content.html')))
->addPart(file_get_contents('assets/content.html'), 'text/html');
// Send it (or at least try to)
if(!$mailer->send($message, $errors)) {
echo 'Mailer Error: ';
print_r($errors);
} else {
echo 'Message sent!';
}
// EOF
<html>
tag tellling you if the browser suppors feature X or not
<html lang="en" dir="ltr" id="modernizrcom" class="js no-touch postmessage history multiplebgs boxshadow opacity cssanimations csscolumns cssgradients csstransforms csstransitions fontface localstorage sessionstorage svg inlinesvg blobbuilder bloburls download formdata wf-proximanova1proximanova2-n4-active wf-proximanova1proximanova2-i4-active wf-proximanova1proximanova2-n7-active wf-proximanova1proximanova2-i7-active wf-proximanovacondensed1proximanovacondensed2-n6-active wf-athelas1athelas2-n4-active wf-active js flexbox flexbox-legacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths tk-loaded wf-active">
.no-borderradius .box {
/* a bit less padding perhaps? Or some background image? */
}
sessionStorage
, but if you plug in a sessionStorage polyfill, it'll work without needing to adjust your codeyepnope({
test: Modernizr.geolocation,
yep: 'regular-styles.css',
nope: ['modified-styles.css', 'geolocation-polyfill.js']
});
onclick
handler
var square = document.getElementById('square');
for (var i = 0; i < 100; i++) {
square.style.left = parseInt(square.style.left) + 1 + 'px';
}
setTimeOut()
or setInterval()
or requestAnimationFrame()
var square = document.getElementById('square2'),
i = 0;
var move = function() {
square.style.left = parseInt(square.style.left) + 1 + 'px';
if (i++ < 100) setTimeout(move, 1000 / 60);
}
move();
crontab
wget
or curl
cap deploy
on your machine, sit back, and enjoy the showpython git-ftp.py
to upload (FTP) the files committed in Git since you've last run the command.This will make your life easier
The idea behind a framework is to offer a design you can use across multiple applications. All applications have a number of basic things in common. A framework is designed to provide a structure for those common elements (database interaction, presentation layer, application logic) so you spend less time writing up database interface code or presentation-layer interfaces and more time writing the application itself.
from ibm.com
Maybe you can update my website?
A content management system (CMS) allows publishing, editing and modifying content as well as site maintenance from a central page. It provides a collection of procedures used to manage work flow in a collaborative environment.
from wikipedia.org
NPM
(cfr. Composer for PHP)
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
module.exports = function(grunt) {
grunt.initConfig({
lint: { all: ['js/*.js'] },
concat: { 'build/pointer.js': [
'js/libs/modernizr-touch.js',
'js/gesture.js',
'js/doubletap.js',
'js/longpress.js',
'js/scale.js']
},
min: { 'build/pointer.min.js': ['build/pointer.js'] },
});
grunt.registerTask('default', 'lint concat min');
};
bower install jquery
bower update jquery
If you don't like my code, Fork off!
If you're looking for the more honest, truthful answer to pretty much any question on web design and usability, here it is: It depends.