Usage :
chmod u+x ./zen.sh
./zen.sh my-dcos-stack
"use strict"; | |
/** | |
* Copyright (c) 2015, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
*/ |
Usage :
chmod u+x ./zen.sh
./zen.sh my-dcos-stack
(ns core | |
(:require [cljsjs.react-select])) | |
(defn my-select [] | |
[:> js/Select {:name "Select" | |
:value "Tom" | |
:on-change #(println "Change ! : " %) | |
:filter-options false | |
:options [{:value "Tom" :label "Tommy"} | |
{:value "Tom2" :label "Tommy2"} |
(ns db | |
(:require [[ragtime.jdbc :as ragjdbc] | |
[clojure.tools.logging :as log] | |
[clojure.java.jdbc :as jdbc] | |
[ragtime.repl :as ragrepl]]) | |
(defn ragtime-config [database] | |
{:datastore (ragtime.jdbc/sql-database database) | |
:migrations (ragtime.jdbc/load-resources "migrations")}) |
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility | |
import com.fasterxml.jackson.annotation.PropertyAccessor | |
import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper, SerializationFeature} | |
import com.fasterxml.jackson.module.scala.DefaultScalaModule | |
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper | |
import com.spotify.scio.ContextAndArgs | |
import com.spotify.scio.values.WindowOptions | |
import org.apache.beam.sdk.io.TextIO.CompressionType | |
import org.apache.beam.sdk.transforms.windowing.AfterProcessingTime | |
import org.apache.beam.sdk.values.WindowingStrategy.AccumulationMode |
abstract class UserWSEndpoint[F[+ _]: Timer: Concurrent: ContextShift]( | |
broadcastTopic: Topic[F, PushNotification])(implicit F: ConcurrentEffect[F]) | |
extends Http4sDsl[F] | |
with Loggable { | |
def broadcast(e: PushNotification) = broadcastTopic.publish1(e) | |
def toText[A: Encoder](a: A)(implicit e: Encoder[A], wse: Encoder[WSMessage]) = | |
Text(wse(WSMessage("", "", e(a).some, "", "".some)).asString.get) |
import io.circe.magnolia.derivation.encoder.auto._ | |
import org.http4s.rho._ | |
import cats.implicits._ | |
import cats.effect._ | |
import com.us.repos._ | |
class AppsEndpoint[F[+ _]: Effect](appsDao: AppsRepo[F], swaggerSyntax: SwaggerSyntax[F]) extends RhoRoutes[F] { | |
import swaggerSyntax._ | |
// If appsDao.list is F[Seq[App]] then the jsonEncoder outputs '[...]' |
<?php | |
global $wpdb; | |
$current_user_id = get_current_user_id(); | |
$search_history = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}relevanssi_log WHERE user_id = {$current_user_id} ORDER BY time DESC"); | |
?> |
const j = '{"type":"Buffer","data":[93,204,151,170,0,0,194,155,10,119,139,1,10,13,41,43]}' | |
const buffer = Buffer.from(JSON.parse(j).data) | |
console.log(typeof buffer); | |
console.log('str' + buffer.toString('hex')) | |
const j = '{"type":"Buffer","data":[93,204,151,170,0,0,194,155,10,119,139,1,10,13,41,43]}' | |
const buffer = Buffer.from(JSON.parse(j).data) | |
console.log(JSON.stringify(buffer)); // verify that a buffer is stringified as the string above by default | |
console.log('buffer string value : ' + buffer.toString('hex')) // concat with str | |