This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oneToTen.reduce(function(acc, a) { | |
return acc + a; | |
}, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
height: 510 | |
border: no | |
license CC0-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH R AS ( | |
SELECT (case when strpos(R.msisdn, '372') = 1 then substr(R.msisdn, 4) else R.msisdn end) as redshift_msisdn, R.msisdn as full_msisdn, | |
R."timestamp" as redshift_timestamp | |
FROM ( | |
SELECT * | |
FROM dblink('redshift_server',$REDSHIFT$ | |
SELECT u.msisdn, u.timestamp from user_sessions u | |
WHERE u.timestamp >= '2018-06-10Z' | |
AND u.offer_id = 853 | |
AND u.country_code = 'EE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Control.Monad.Eff | |
import Control.Monad.Eff.Console | |
import Control.Monad.Free | |
import Control.Monad.Eff.Class (class MonadEff, liftEff) | |
import Control.Monad.Eff.Ref (REF, Ref, newRef, modifyRef, readRef) | |
import Control.Monad.Trans.Class (class MonadTrans, lift) | |
import Control.Monad.Reader (class MonadAsk, ReaderT, ask, runReaderT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Counter where | |
import Prelude | |
import Control.Monad.Eff.Class (class MonadEff, liftEff) | |
import Control.Monad.Eff.Console (logShow) | |
import Control.Monad.RWS.Trans (class MonadTrans) | |
import Control.Monad.State (StateT, get, put, runStateT) | |
import Control.Monad.Trans.Class (lift) | |
import Data.Tuple (Tuple) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.babel = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | |
},{}],2:[function(_dereq_,module,exports){ | |
// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 | |
// | |
// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! | |
// | |
// Originally from narw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TextTable = function (rows_, opts) { | |
if (!opts) opts = {}; | |
var hsep = opts.hsep === undefined ? ' ' : opts.hsep; | |
var align = opts.align || []; | |
var stringLength = opts.stringLength | |
|| function (s) { return String(s).length; } | |
; | |
var dotsizes = reduce(rows_, function (acc, row) { | |
forEach(row, function (c, ix) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true | |
do | |
echo -e "GET http://google.com HTTP/1.0\n\n" | nc -w2 google.com 80 > /dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
echo $(date +"%T") " Online" | |
else | |
echo $(date +"%T")" Offline" | |
say "offline" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TextTable = function (rows_, opts) { | |
if (!opts) opts = {}; | |
var hsep = opts.hsep === undefined ? ' ' : opts.hsep; | |
var align = opts.align || []; | |
var stringLength = opts.stringLength | |
|| function (s) { return String(s).length; } | |
; | |
var dotsizes = reduce(rows_, function (acc, row) { | |
forEach(row, function (c, ix) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p thumbs | |
for f in *.jpg; do | |
size=$(identify -format "%[fx:w]" $f) | |
sizeh=$(expr $size / 2) | |
convert -size "$size"x"$size" xc:none -fill $f -draw "fill white circle $sizeh,$sizeh $sizeh,1" thumbs/$f.png | |
; done |
NewerOlder