Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# this forces dpkg not to call sync() after package extraction and speeds up install | |
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup | |
# we don't need and apt cache in a container | |
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
#!/usr/bin/env bash | |
set -eu | |
## The Godeps file is expected to have lines like so: | |
# | |
# github.com/nu7hatch/gotrail v2.6 | |
# | |
## where the first element is the import path and the second is a tag | |
## or commit SHA in the project. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Before Emacs 24 the only way to benefit from third party elisp packages was to copy them to your configuration. RMS always opposed a package manager in Emacs because it would make it too easy to install non-free additions (this might not be a 100% accurate represetation of what happened, it’s what I remember hearing/reading).
In any case, Emacs 24 shipped with package.el, so now there’s a package manager. You can do M-x list-packages
and it will fetch a list of packages from one or more package repositories. You find the package you want, type i
, then x
and it installs.
There are a few different repositories. The “official” one from GNU is called ELPA. The most popular one with lots more than ELPA is MELPA. Here is how you add MELPA to your config:
(ns shades.lenses) | |
; We only need three fns that know the structure of a lens. | |
(defn lens [focus fmap] {:focus focus :fmap fmap}) | |
(defn view [x {:keys [focus]}] (focus x)) | |
(defn update [x {:keys [fmap]} f] (fmap f x)) | |
; The identity lens. | |
(defn fapply [f x] (f x)) | |
(def id (lens identity fapply)) |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
This is a guide on how to email securely.
There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.
;;; To add a tooltip, write (tooltip {:className "foo"}) instead of #js {:className "foo"} | |
;;; You can simplify this and just show what you need: #js {:title (pr-str (om/...))}. | |
;;; testfoo.core (cljs) | |
(ns testfoo.core | |
(:require-macros [testfoo.macros :refer (tooltip)]) | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true] | |
[cljs.reader :as reader])) |