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
#!/bin/env ruby | |
# --- Configuration --------------------------------- | |
# Remove artifacts which were created before $age_days ago and haven't been downloaded in recent $age_days. | |
$age_days = 8 | |
# The repository to be cleaned. | |
$repo = 'lib-release-local' |
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
(defproject product "0.1.0-SNAPSHOT" | |
:description "Product Search for Orion MCP" | |
:url "http://example.com/FIXME" | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[compojure "1.1.6"] | |
[liberator "0.5.0"] | |
[ring/ring-json "0.2.0"] | |
[rotary "0.4.1"] | |
[org.clojure/data.json "0.2.2"]] | |
:plugins [[lein-ring "0.8.10"]] |
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
(ns dynamodb.dynamodb-client | |
(:require [cljs.nodejs :as node] | |
[cljs.core :as cljs])) | |
(def express (node/require "express")) | |
(def express-middlewares (node/require "express-middlewares")) | |
(def app (express)) | |
(.use app (.bodyParser express-middlewares)) | |
(def aws (node/require "aws-sdk")) | |
(def deals-all {:TableName "commerce.business.promote.DEAL" |
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
(ns interop.core | |
(:require [monger.core :as mongo] | |
[monger.collection :as mc] | |
[monger.operators :refer :all] | |
[clojure.data.json :as json]) | |
(:gen-class :name com.mongodb.dao.Deals | |
:methods [#^{:static false} [saveDeal [java.lang.String] java.lang.String] | |
#^{:static false} [getDealsByIds [java.lang.String java.util.Set] java.lang.String] | |
#^{:static false} [saveEffectiveDeals [java.util.List] void] | |
#^{:static false} [getEffectiveDeals [java.lang.String java.lang.String java.lang.String] java.lang.String]])) |
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
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.function.Function; | |
import java.util.stream.Stream; | |
public class ExtensionTester { | |
//================================ Supporting classes ====================================== |
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
package com.examples; | |
import java.util.stream.IntStream; | |
import java.util.stream.LongStream; | |
import java.util.stream.Stream; | |
public class FuncVsImp { | |
public static int fibonacciSingleValueIter(int x) { | |
int a = 1; |
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
/** | |
The following is not a java class, but some interfaces and implementations of Functors and Monads and a test class(Main.java) | |
FUNCTOR: | |
A functor is a typed data structure that encapsulates some value(s). Benefits of functors - they abstract away the internal representation and provide consistent, easy to use API over various data structures. | |
MONAD: | |
A monad a set of three things: | |
* a parameterized type M<T> |
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
public class Currying { | |
// curry method | |
public static <A, B, C> Function<A, Function<B, C>> curry(final BiFunction<A, B, C> f) { | |
return (A a) -> (B b) -> f.apply(a, b); | |
} | |
// ADD function | |
public static BiFunction<Integer, Integer, Integer> biAdd = (a, b) -> { | |
return a + b; |
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
var s1 = "my&friend&Paul has heavy hats! &" | |
var s2 = "my friend John has many many friends &" | |
// mix(s1, s2) --> "2:nnnnn/1:aaaa/1:hhh/2:mmm/2:yyy/2:dd/2:ff/2:ii/2:rr/=:ee/=:ss" | |
// var s1 = "Are they here"; | |
// var s2 = "yes, they are here"; | |
// "2:eeeee/2:yy/=:hh/=:rr") | |
// Test.assertEquals(mix("looping is fun but dangerous", "less dangerous than coding"), "1:ooo/1:uuu/2:sss/=:nnn/1:ii/2:aa/2:dd/2:ee/=:gg") |
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
//https://medium.com/@drboolean/monoidal-contravariant-functors-are-actually-useful-1032211045c4 | |
const log = require('./lib/log') | |
log( | |
'testing' | |
) | |
const daggy = require('daggy') |
OlderNewer