(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.
| <!-- normally this stuff would be on the html element --> | |
| <!--[if lt IE 7]> <div class="ie ie6 lte9 lte8 lte7"> <![endif]--> | |
| <!--[if IE 7]> <div class="ie ie7 lte9 lte8 lte7"> <![endif]--> | |
| <!--[if IE 8]> <div class="ie ie8 lte9 lte8"> <![endif]--> | |
| <!--[if IE 9]> <div class="ie ie9 lte9"> <![endif]--> | |
| <!--[if gt IE 9]> <div> <![endif]--> | |
| <!--[if !IE]><!--> <!--<![endif]--> | |
| <!DOCTYPE html> | |
| <html> |
| -- check for exact matches | |
| WITH index_cols_ord as ( | |
| SELECT attrelid, attnum, attname | |
| FROM pg_attribute | |
| JOIN pg_index ON indexrelid = attrelid | |
| WHERE indkey[0] > 0 | |
| ORDER BY attrelid, attnum | |
| ), | |
| index_col_list AS ( | |
| SELECT attrelid, |
(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.
| #!/bin/bash | |
| CONSUL="localhost:8500" | |
| main() { | |
| case "$1" in | |
| info) | |
| curl -s "$CONSUL/v1/kv/$2" | jq -r .[] | |
| ;; | |
| get) |
| #!/usr/bin/env ruby | |
| # Author : Emad Elsaid (https://github.com/blazeeboy) | |
| FILENAME = 'db.txt' | |
| OPEN, CLOSE = 1 , 0 | |
| file = File.open(FILENAME, 'a') | |
| file.write "#{OPEN} : #{Time.new}\n" | |
| file.flush | |
| begin |
| script = "\ | |
| local current, expected, cur_val, callcount, maxcps \ | |
| current = redis.call('GET', KEYS[1]) \ | |
| callcount = tonumber(ARGV[1]) \ | |
| maxcps = tonumber(ARGV[2]) \ | |
| cur_val = 0 \ | |
| if current then \ | |
| cur_val = tonumber(current) \ | |
| end \ | |
| expected = cur_val + callcount \ |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| --EVAL 'this script' 1 some-key | |
| local key = KEYS[1]; | |
| local value = redis.call('GET', key); | |
| local jvalue = cjson.encode(cmsgpack.unpack(value)); | |
| return jvalue; |
Based on D3.JS and Dimple, ChartFactory provide the ability to build quickly D3.JS charts without coding any lines of javascript. Just define your dashboard in a JSON and voila !
charts: [
{id:'chart1',
width:800,height:250,
xAxis:{type:'Category',field: "Month",orderRule:'Date'},
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |