(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.
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
#!/usr/bin/php | |
<?php | |
/* | |
* Convert JSON file to CSV and output it. | |
* | |
* JSON should be an array of objects, dictionaries with simple data structure | |
* and the same keys in each object. | |
* The order of keys it took from the first element. | |
* | |
* Example: |
// If Array was already sorted | |
// Complexity - O(n) | |
private int[] findPair_4(int[] A) { | |
int left = 0, right = A.length - 1; | |
while (left < right) { | |
int s = A[left] + A[right]; | |
if (s == 0) | |
return new int[]{A[left], A[right]}; | |
else if (s > 0) | |
right--; |
; Аппликативный и нормальный порядки вычисления | |
; | |
; «полная подстановка, затем редукция» известен под на- | |
; званием нормальный порядок вычислений (normal-order evaluation) | |
; | |
; Пример работы нормального порядка вычисления | |
; Последовательность подстановок | |
; (sum-of-squares (+ 5 1) (* 5 2)) | |
; (+ (square (+ 5 1)) (square (* 5 2)) | |
; (+ (* (+ 5 1) (+ 5 1)) (* (* 5 2) (* 5 2))) |
(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 | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
# Cache 10GB for 1 Month | |
proxy_cache_path /var/cache/nginx keys_zone=GS:10m inactive=720h max_size=10240m; | |
upstream gs { | |
server 'storage.googleapis.com:80'; | |
keepalive 100; | |
} | |
server { | |
set $my_domain "yourdomain.com"; |
#!/bin/bash | |
mkdir -p /opt/bin | |
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |
sudo su - | |
mkdir -p /opt/bin | |
curl -L https://github.com/docker/compose/releases/download/1.5.1/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |
GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)
~=
&&