Skip to content

Instantly share code, notes, and snippets.

@lewang
lewang / index.html
Last active August 29, 2015 14:06
html5 slider
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Range Slider Test</title>
<link rel="stylesheet" type="text/css" href="rangetest.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="range-container">
;; Copyright © 2014 Le Wang
;; Author: Le Wang
;; Maintainer: Le Wang
;; Description: Use flx algorithm for fuzzy helm matching.
;; Created: 2014-12-27
;; Version: 0.1
;; URL: https://github.com/lewang/helm-flx.el
;; Package-Requires: ((heap "0.3"))
{
"question_id": "q_1a",
"label": "When was the last time that you had significant problems with feeling very trapped, lonely, sad, blue, depressed, or hopeless about the future?",
"question_type_id": "segmented_slider",
"unskippable": false,
"possible_responses": [
{
"value": "Past month",
"label": "Past month",
"tallies": {

SSL reissue nginx [2014-04-10 Thu 11:25]

  1. Reissue CSR and private key. chmod “400” on that private key
    • openssl req -new -newkey rsa:2048 -nodes -keyout star_tickitforhealth_com_2.key -out foo_new.csr
  2. Generate new crt package from your SSL issuer using CSR. Munge as required.
  3. Update nginx config to use new crt package and private key.
{
"question_id": "servings_fruits",
"question_type_id": "feedback_icon_boxes",
"translations": {
"en": {
"label": "What is a “serving” of fruits and vegetables"
}
},
"feedback_sections": [
{
@lewang
lewang / dualbar.js
Last active September 15, 2015 23:02 — forked from maaquib/index.html
D3JS Bar Graph (Above and Below x-axis with animation)
window.onload=function(){
var data = [-15, 20, -22, 18, -2, 6, -26, 18],
duration = 300;
var margin = {top: 30, right: 10, bottom: 10, left: 30},
width = 320 - margin.left - margin.right,
height = 250 - margin.top - margin.bottom;
var y0 = Math.max(Math.abs(d3.min(data)), Math.abs(d3.max(data)));
var y = d3.scale.linear()
@lewang
lewang / README.md
Last active September 15, 2015 23:36 — forked from mbostock/.block
Bar Chart
@lewang
lewang / README.md
Last active September 16, 2015 03:00 — forked from mbostock/.block
Grouped Bar Chart

This grouped bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:

@lewang
lewang / README.md
Last active September 18, 2015 16:12 — forked from mbostock/.block
General Update Pattern, III

By adding transitions, we can more easily follow the elements as they are entered, updated and exited. Separate transitions are defined for each of the three states.

Note that no transition is applied to the merged enter + update selection; this is because it would supersede the transition already scheduled on entering and updating elements. It's possible to schedule concurrent elements by using transition.transition or by setting transition.id, but it's simpler here to only transition the x-position on update; for entering elements, the x-position is assigned statically.

Want to read more? Try these tutorials:

@lewang
lewang / anything-config.el.diff
Created January 1, 2012 03:30
patch for anything-config.el fix anything-regexp issue with folded text
diff --git a/anything-config.el b/anything-config.el
index dbfdcd0..abfa1e8 100644
--- a/anything-config.el
+++ b/anything-config.el
@@ -2149,15 +2149,22 @@ Default is `anything-current-buffer'."
(defun anything-region-active-p ()
(and transient-mark-mode mark-active (/= (mark) (point))))
-(defun anything-goto-line (lineno)
- "Goto LINENO opening only outline headline if needed."