SOLARIZED | HEX | 16/8 | TERMCOL | XTERM | HEX | L*A*B |
RGB | HSB | GNU screen |
---|---|---|---|---|---|---|---|---|---|
base03 | #002b36 | 8/4 | brblack | 234 | #1c1c1c | 15,-12,-12 |
0,43,54 |
193,100,21 |
K |
base02 | #073642 | 0/4 | black | 235 | #262626 | 20,-12,-12 |
7,54,66 |
192,90,26 |
k |
base01 | #586e75 | 10/7 | brgreen | 240 | #585858 | 45,-07,-07 |
88,110,117 |
194,25,46 |
G |
base00 | #657b83 | 11/7 | bryellow | 241 | #626262 | 50,-07,-07 |
101,123,131 |
195,23,51 |
Y |
base0 | #839496 | 12/6 | brblue | 244 | #808080 | 60,-06,-03 |
131,148,150 |
186,13,59 |
B |
base1 | #93a1a1 | 14/4 | brcyan | 245 | #8a8a8a | `65,-05 |
// check version | |
node -v || node --version | |
// list locally installed versions of node | |
nvm ls | |
// list remove available versions of node | |
nvm ls-remote | |
// install specific version of node |
/** | |
* Print Stylesheet fuer Deinewebsite.de | |
* @version 1.0 | |
* @lastmodified 16.06.2016 | |
*/ | |
@media print { | |
/* Inhaltsbreite setzen, Floats und Margins aufheben */ | |
/* Achtung: Die Klassen und IDs variieren von Theme zu Theme. Hier also eigene Klassen setzen */ |
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ | |
/* ========================================================================== | |
HTML5 display definitions | |
========================================================================== */ | |
/** | |
* Correct `block` display not defined in IE 8/9. | |
*/ |
Service Worker - offline support for the web
- Service Worker - Revolution of the Web Platform
- The Service Worker is Coming - Look Busy (vid)
- Service Workers: Dynamic Responsive Images using WebP Images
- Is Service Worker ready?
Progressive apps - high-res icon, splash screen, no URL bar, etc.
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
class Metronome | |
def self.start(bpm: 120) | |
loop do | |
print "\a" | |
sleep (60 / bpm.to_f) | |
end | |
rescue Interrupt | |
puts "Exiting." | |
end | |
end |
HTML and Sinatra really only support the GET and the POST methods. In order to be able to use the PUT and DELETE methods in Sinatra, you kind of have to "trick" the form to go to the right place. Then you can name the routes the proper way - otherwise you can only really work with GET and POST.
I used the Craiglist Jr challenge for some examples. Let's look at a quick example of a POST form/method/route- in this case, we're creating a new Craigslist article:
POST form and corresponding route:
<form action="/article/new" method="post">
--------------------------------
YOUR FORM FIELDS HERE
require 'sinatra/base' | |
require 'minitest/autorun' | |
require 'minitest/spec' | |
require "rack/test" | |
require 'nokogiri' | |
class MyApp < Sinatra::Base | |
enable :inline_templates | |
get '/users/:id' do |
To avoid receiving an error when you attempt to access one of your routes and accidentally leave a trailing slash on the URL, you can use Rack::Rewrite to redirect the browser to the same URL without the trailing slash.
First add the gem to your Gemfile
gem 'rack-rewrite', '~> 1.5.0'
Run bundle install