Skip to content

Instantly share code, notes, and snippets.

View Dr-Nikson's full-sized avatar
🎯
Focusing

Nik Gushchin Dr-Nikson

🎯
Focusing
  • Russia
View GitHub Profile
// @flow
interface Command<A> {
run(): A;
}
class Call<A> implements Command<A> {
value: () => A;
constructor<X>(f: X => A, x: X) {
@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@bvaughn
bvaughn / eager-prefetching-async-data-example.js
Last active November 30, 2022 21:16
Advanced example for eagerly prefetching async data in a React component.
// This is an advanced example! It is not intended for use in application code.
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices.
// Most components should just initiate async requests in componentDidMount.
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null,
};
@zerobias
zerobias / .flowconfig
Last active January 25, 2018 09:48
More effective flow typings
[options]
module.name_mapper='^most-subject$' -> '<PROJECT_ROOT>/most-subject'
@zerobias
zerobias / curry3.js
Created November 29, 2017 05:05
Flow curry3
//@flow
declare export function curry3<A, B, C, D>(fn: (a: A, b: B, c: C) => D): (
& ((a: A, nob: void, noc: void) => (
& ((b: B, noc: void) => ((c: C) => D))
& ((b: B, c: C) => D)
))
& ((a: A, b: B, noc: void) => ((c: C) => D))
& ((a: A, b: B, c: C) => D)
)
@pathikrit
pathikrit / ProducerConsumer.scala
Last active October 28, 2018 05:06
Single synchronous Producer/Consumer in Scala
import java.util.concurrent.ArrayBlockingQueue
import scala.concurrent.{ExecutionContext, Future}
/**
* Rick's implementation of ghetto back-pressure algo
* Implement this trait and pass it off to ProducerConsumer.Runner to run it
*
* @tparam R Type of result to be crunched
* @tparam S State to iterate on
@javivelasco
javivelasco / reactive-2015.md
Last active October 2, 2022 16:36
Proposal for lightning talk at Reactive Conf 2015

I’m amazed by React and how it’s bringing happiness to our developer lives. I specially like the workflow that integrates Webpack + React + CSS Modules + Babel among other tools and preprocessors. That’s why Javier Jiménez and I are working together in a library called React Toolbox that we would like to show in a lightning talk at Reactive Conference.

The main idea is to create a set of React components implementing Material Design guidelines. There are already some libraries that solve a similar problem but our project is mostly focused on the workflow and best practices to create a tool everybody would want to use. Also, we are sticking to the design guidelines proposed by Google and embracing minimalism by generating the minimum possible amount of HTML and styles to get the best result. Our workflow includes among others:

  • Webpack.
  • ES6 with Babel
  • Unit t
@beshkenadze
beshkenadze / react_tz.md
Last active December 21, 2023 18:22
Тестовое задание для ReactJS Frontend-разработчика

##Погодное одностраничное веб-приложение

(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.

(!) Обязательно использовать react.js и redux.

Приложение должно уметь:

  • Добавлять/удалять города
  • Сохранять локально данные
@eicnix
eicnix / RequestSpec.scala
Created July 14, 2015 07:50
Simple response mocking for dispatch using scalamock
// Example for lukaseichler.de/how-to-test-dispatch-request/
import dispatch.{HttpExecutor, _}
import dispatch.Defaults._
val httpMock = mock[HttpExecutor]
(httpMock.apply(_: (Request, AsyncHandler[String]))(_: ExecutionContext))
.expects(*, *)
.returning(Future[String] {
"Hello World"