An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.
C-M-f | sp-forward-sexp |
C-M-b | sp-backward-sexp |
Object.defineProperty(Object.prototype, "extend", {value: function (obj) { | |
obj.__proto__ = this; | |
return obj; | |
}}); | |
Object.defineProperty(Object.prototype, "new", {value: function () { | |
var obj = Object.create(this); | |
if (obj.initialize) obj.initialize.apply(obj, arguments); | |
return obj; | |
}}); |
(defun increment (sequence val n) | |
(substitute (1+ val) val sequence | |
:from-end (< n 0) | |
:count (if (= n 0) nil (abs n)))) |
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
from django.contrib import admin, messages | |
from django.http import HttpResponseRedirect | |
from django.shortcuts import render | |
from my_app.forms import CustomForm | |
class FakeModel(object): | |
class _meta: | |
app_label = 'my_app' # This is the app that the form will exist under |
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem | |
chmod 600 id_rsa.pem |
An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.
C-M-f | sp-forward-sexp |
C-M-b | sp-backward-sexp |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start