In React's terminology, there are five core types that are important to distinguish:
React Elements
web: node app.js | |
worker: node consumer.js |
import BaseHTTPServer | |
class Handler(BaseHTTPServer.BaseHTTPRequestHandler): | |
mappings = {'/' : {'GET' : 'test'}} | |
def main_handler(self, method='GET'): | |
# get request url (without url params) and remove trailing / | |
request_url = self.path.split('?')[0].rstrip('/') |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
# | |
# Install the MYSQL driver | |
# gem install mysql2 | |
# | |
# Ensure the MySQL gem is defined in your Gemfile | |
# gem 'mysql2' | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: |
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |
In React's terminology, there are five core types that are important to distinguish:
React Elements
# Swift syntax highlighting for Vim | |
# Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/ | |
echo "--- Installing and configuring Pathogen.." | |
mkdir -p ~/.vim/autoload ~/.vim/bundle | |
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
echo "execute pathogen#infect() | |
syntax on |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
### | |
FROM mhart/alpine-node | |
RUN npm install -g http-server | |
WORKDIR /site | |
ADD ./ /site | |
# The default port of the application |
# Redis Cheatsheet | |
# All the commands you need to know | |
redis-server /path/redis.conf # start redis with the related configuration file | |
redis-cli # opens a redis prompt | |
# Strings. |