Skip to content

Instantly share code, notes, and snippets.

jhegedus42

  • Helsinki
Block or report user

Report or block jhegedus42

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jhegedus42
jhegedus42 / gist:2917d9ebdc50f911d5a1688d6408046b
Created Jul 26, 2019
css-dsl - for irie - trying to get it resolved - no luck
View gist:2917d9ebdc50f911d5a1688d6408046b
Jozsefs-MBP:irie joco$ sbt
[info] Loading global plugins from /Users/joco/.sbt/1.0/plugins
[info] Loading settings for project irie-build from plugins.sbt ...
[info] Loading project definition from /Users/joco/dev/im/irie/project
[info] Loading settings for project irie from build.sbt ...
[info] Set current project to IM root project (in build file:/Users/joco/dev/im/irie/)
[info] sbt server started at local:///Users/joco/.sbt/1.0/server/bacc02467050f0642b40/sock
sbt:IM root project> clean
[success] Total time: 0 s, completed Jul 27, 2019 1:17:18 AM
sbt:IM root project> reload
View gist:4d5adb1806ea2a99c03e09c2ec2fc592
Jozsefs-MBP:irie joco$ sbt clean update
[info] Loading global plugins from /Users/joco/.sbt/1.0/plugins
[info] Loading settings for project irie-build from plugins.sbt ...
[info] Loading project definition from /Users/joco/dev/im/irie/project
/Users/joco/dev/im/irie/build.sbt:28: warning: lazy value CrossType in object AutoImport is deprecated (since 0.6.23): The built-in cross-project feature of sbt-scalajs is deprecated. Use the separate sbt plugin sbt-crossproject instead: https://github.com/portable-scala/sbt-crossproject
(crossProject.crossType( CrossType.Pure ) in file(
^
[info] Loading settings for project irie from build.sbt ...
[info] Set current project to IM root project (in build file:/Users/joco/dev/im/irie/)
[success] Total time: 0 s, completed Jul 27, 2019 12:13:41 AM
View gist:a4bfd9e24e893eb36dff88e2fdf364c4
this call:
val f: Future[XMLHttpRequest] = Ajax.put(url_str, json_line)
generates:
OPTIONS /Line HTTP/1.1
Content-Type: text/plain;charset=UTF-8
Referer: http://localhost/
User-Agent: Node.js (linux; U; rv:v6.11.0) AppleWebKit/537.36 (KHTML, like Gecko)
View gist:c6ef9257d828e99292778f3338f93e7d
object ClientRestAJAX {
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
def getEntity[E <: Entity: ClassTag: Decoder](
ref: Ref[E]): Future[HttpGetRequestResult[E]] = {
val url: GetURL = ref
val url_str = url.toURLWithHostAsString
val f: Future[XMLHttpRequest] = Ajax.get(url_str)
View gist:aaf90bafe45db5b2e6b1a250f78ba494
package app.client.reactComponents._experiments
import app.client.reactComponents._experiments.InnerComp.{
ICType,
PropsWithState
}
import japgolly.scalajs.react.CompScope.DuringCallbackU
import japgolly.scalajs.react.ReactComponentB.{P, PSB}
import japgolly.scalajs.react.ReactComponentC.ReqProps
@jhegedus42
jhegedus42 / Implicit.scala
Created Apr 8, 2017
playing around with implicits
View Implicit.scala
import MyProducers.MapProducer
trait Entity
case class Ref[T](id: String)
case class IntEntity(int: Int)
case class StringEntity(s: String)
trait RefResolver {
View gist:9c478a07ff4244dac7581424d88a2e1c
@js.native
trait Props extends js.Object {
var value: String = js.native
var index: Int = js.native
var key: String = js.native
}
case class ScalaProps(val value:String, val index:Int, val key:String)
// how do i convert ScalaProps to Props ?
View Main.purs
module Main where
import Prelude
import Data.Foldable (for_)
import Data.String (length, fromCharArray)
import Data.Unfoldable (replicate)
import Control.Monad.Eff
import Control.Monad.Eff.Console (log)
View gist:97052583284f9c2015b9a8dbc725b21c
In Scala:
@js.native
trait Props extends js.Object {
val value: String = js.native
val items: scala.collection.mutable.Seq[String] = js.native
}
@JSExport
val TestCompB: ReqProps[Props, Unit, Unit, TopNode] =
View gist:287e6b24228bda786cf6ef8cce63cd3a
@js.native
trait Window extends js.Object {
def alert(message: String): Unit = js.native
}
@js.native
@JSName("window")
object W extends Window
You can’t perform that action at this time.