Instantly share code, notes, and snippets.

View how-to-set-up-stress-free-ssl-on-os-x.md

How to set up stress-free SSL on an OS X development machine

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

View run_shell_cmd.py
#!/usr/bin/env python3
import subprocess
def run_shell_cmd(cmd, *shell):
# Might want to use a "try" or call.check in case Command fails
if "shell" in shell.lower():
process = subprocess.Popen(cmd,
stdout=subprocess.PIPE, shell=True)
View ideavimrc
" space leader
let mapleader = " "
" Plugins
set surround
set hlsearch
set scrolloff=3
set ignorecase smartcase
set showmode
View stm.md

In computer science, software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock-based synchronization. STM is a strategy implemented in software, rather than as a hardware component. A transaction in this context occurs when a piece of code executes a series of reads and writes to shared memory. These reads and writes logically occur at a single instant in time; intermediate states are not visible to other (successful) transactions. The idea of providing hardware support for transactions originated in a 1986 paper by Tom Knight.[1] The idea was popularized by Maurice Herlihy and J. Eliot B. Moss.[2] In 1995 Nir Shavit and Dan Touitou extended this idea to software-only transactional memory (STM).[3] Since 2005, STM has been the focus of intense research[4] and support for practical implementations is growing.

Transactional locking

STM can be implemented as a lock-fre

View notes.md

Notes on 7 concurrency model in 7 weeks

// This notes is for vietnamruby #hardcore learning group

Author

  • Paul Butcher - https://paulbutcher.com/
  • Consultant
  • He was Chief Software Architect of SwiftKey,
  • Chief Technical Officer of Texperts and
  • Chief Technical Officer of Smartner.
View gist:68ac9f261d4fec7a92be58274c3d0c30
curl -XDELETE "http://localhost:9200/geo_polygon"
curl -XPOST "http://localhost:9200/geo_polygon"
# We index points with geo_point and geo_shape types for testing purpose
curl -XPOST "http://localhost:9200/geo_polygon/loc/_mapping" -d'
{
"loc": {
"properties": {
View .gitignore
# Download this file using PowerShell v3 under Windows with the following comand
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
View accordion-test
(defn accordion-test
[x]
(let [{:keys [title content active?]} x]
[:div.accordion
{:class (when active? "active")}
[:div.title
{:on-click #(prn "something")
:style {:cursor "pointer"}}
title]
View gist:af34b460e149001b3a06
(ns css.components.tab
(:require
[cljs.test :refer-macros [is async]]
[om.next :as om :refer-macros [defui]]
[sablono.core :as sab :include-macros true]
[reagent.core :as r])
(:require-macros
[devcards.core :as dc :refer [defcard deftest defcard-rg]]))
(defui Menu1
View gist:0cb8cb9eb8c3e2f43e9c
(ns onyx-starter.core
(:require
[clojure.core.async :as async]
[onyx.plugin.core-async :refer [take-segments!]]
[com.stuartsierra.component :as component]
[taoensso.timbre :refer [info error] :as timbre]
[onyx.plugin.kafka]
[clj-kafka.producer :as kp]
[clj-kafka.admin :as kadmin]
[onyx.kafka.embedded-server :as ke]