(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.
package com.webile.upload; | |
import java.io.BufferedReader; | |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStreamReader; | |
import java.util.Date; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.methods.HttpPost; |
#/bin/sh | |
# this script greps .rb files on the the current directory recursively for a word displaying the line, line number and file path. | |
# greps recursively ruby files and displaing lines | |
grep -r -n --include="*.rb" $1 . | | |
# strip white spaces | |
tr -d ' '| |
;(function(ns){ | |
/** | |
* mb_strwidth | |
* @param String | |
* @return int | |
* @see http://php.net/manual/ja/function.mb-strwidth.php | |
*/ | |
var mb_strwidth = function(str){ | |
var i=0,l=str.length,c='',length=0; | |
for(;i<l;i++){ |
<?php | |
/** | |
* php-ansi-color | |
* | |
* Original | |
* https://github.com/loopj/commonjs-ansi-color | |
* | |
* @code | |
* <?php | |
* require_once "ansi-color.php"; |
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding | |
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding |
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
(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.
git ls-tree -r --name-only HEAD | while read filename; do | |
echo "$(git log -1 --format="%at | %h | %an | %ad |" -- $filename) $filename" | |
done |
/** | |
* Convert Excel file to Sheets | |
* @param {Blob} excelFile The Excel file blob data; Required | |
* @param {String} filename File name on uploading drive; Required | |
* @param {Array} arrParents Array of folder ids to put converted file in; Optional, will default to Drive root folder | |
* @return {Spreadsheet} Converted Google Spreadsheet instance | |
**/ | |
function convertExcel2Sheets(excelFile, filename, arrParents) { | |
var parents = arrParents || []; // check if optional arrParents argument was provided, default to empty array if not |
This gist is about:
Mainly:
function
cannot (should not) be used when side-effects occur