This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].
-
[You Don't Know JS][3]
-
[Frontend Masters courses by Kyle Simpson][12]
-
[@mpjme][6]'s [YouTube videos][5]
#!/bin/sh | |
# Set up Rails app. Run this script immediately after cloning the codebase. | |
# Exit if any subcommand fails | |
set -e | |
# Copy over configs | |
if ! [ -f .env ]; then | |
cp .sample.env .env |
const hoverTime = 400 | |
const fetchers = {} | |
const doc = document.implementation.createHTMLDocument('prefetch') | |
function fetchPage (url, success) { | |
const xhr = new XMLHttpRequest() | |
xhr.open('GET', url) | |
xhr.setRequestHeader('VND.PREFETCH', 'true') | |
xhr.setRequestHeader('Accept', 'text/html') | |
xhr.onreadystatechange = () => { |
// | |
// ViewController.swift | |
// TEST_InputViewX | |
// | |
// Created by Greg Pierce on 10/5/17. | |
// Copyright © 2017 Agile Tortoise. All rights reserved. | |
// | |
// Demonstrates how to update an input accessory view | |
// to work on iPhone X with external keyboard attached | |
// using safe area insets. |
require 'aws-sdk' | |
s3 = Aws::S3::Resource.new( | |
region: 'us-east-1', | |
credentials: Aws::InstanceProfileCredentials.new() | |
) | |
bucket = s3.bucket('my-daily-backups') | |
file = (DateTime.now).strftime("%Y.%m.%d-backup") | |
if bucket.object(file).exists? |
class SomeController < ApplicationController | |
before_action :add_http_preload | |
private | |
def add_http_preload | |
# Always add a Link header to responses to this controller | |
http_preload script: "application.js", style: "application.css" | |
http_preload "myfont.woff", as: :font, push: false | |
# TODO: How should crossorigin work? |
If you have any sort of administrative interface on your web site, you can easily imagine an intruder gaining access and mucking about. How do you know the extent of the damage? Adding an audit log to your app is one quick solution. An audit log should record a few things:
Using the Rails framework, this is as simple as adding a before_action
to your admin controllers. Here’s a basic version that I’m using in production.
#! /usr/bin/env bash | |
# Install any build dependencies needed for curl | |
sudo apt-get build-dep curl | |
# Get latest (as of Feb 25, 2016) libcurl | |
mkdir ~/curl | |
cd ~/curl | |
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2 | |
tar -xvjf curl-7.50.2.tar.bz2 |
import React from 'react' | |
export default class Dropdown extends React.Component{ | |
constructor(props){ | |
super() | |
this.state = { show: props.show } | |
this.onClick = this.onClick.bind(this) | |
} | |
onClick(){ |
import Cocoa | |
struct Person { | |
var name: String = "John" | |
var age: Int = 50 | |
var dutch: Bool = false | |
var address: Address? = Address(street: "Market St.") | |
} | |
struct Address { |