Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
| get :upload, :map => "/upload" do | |
| render 'Form.haml' | |
| end | |
| post :upload, :map => "/upload" do | |
| @kitten = Kitten.create(:image => params[:file][:tempfile], :type => params[:type], :age => params[:age]) | |
| redirect @kitten.save ? "/kitten/#{@kitten.id}" : "/upload" | |
| end | |
| get :kitten, :map => "/kitten/:id" do | 
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh | 
Some exercises from the Falsy Values workshops.
The good parts:
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()):
Have tested these instructions successfully under Ubuntu 16.04LTS and 14.04LTS.
Devices > CD/DVD 1 > Connect Image..../Applications/Parallels Desktop/Contents/Resources/Tools/prl-tools-lin.iso.| Info: | See <http://docutils.sf.net/rst.html> for introductory docs. | 
|---|---|
| Author: | David Goodger <[email protected]> | 
| Date: | 2013-02-20 | 
| Revision: | 7612 | 
| Description: | This is a "docinfo block", or bibliographic field list | 
Note
If you are reading this as HTML, please read
| { | |
| "env": { | |
| "browser": true, | |
| "node": true, | |
| "es6": true | |
| }, | |
| "plugins": ["react"], | |
| "ecmaFeatures": { | 
| #!/bin/bash | |
| # Stop all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ] ; then | |
| docker stop $containers | |
| fi | |
| # Delete all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ]; then | |
| docker rm -f -v $containers | 
| #!/bin/bash | |
| # | |
| # This is sp, the command-line Spotify controller. It talks to a running | |
| # instance of the Spotify Linux client over dbus, providing an interface not | |
| # unlike mpc. | |
| # | |
| # Put differently, it allows you to control Spotify without leaving the comfort | |
| # of your command line, and without a custom client or Premium subscription. | |
| # | 
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>