There is a trending 'microservice' library called go-kit. I've been using the go-kit library for a while now. The library provide a lot of convenience integrations that you might need in your service: with service discovery with Consul, distributed tracing with Zipkin, for example, and nice logic utilities such as round robin client side load balancing, and circuit breaking. It is also providing a way to implement communication layer, with support of RPC and REST.
- Star this gist to see the talk at ReactiveConf 2016.
- Retweet to spread the word.
- Have a look at this blog post to see other proposals.
- Try elm-search to see what this is all about.
Elm is a statically typed functional language that compiles to JavaScript. It's well-known for its developer experience: the compiler provides nice error messages, the package system enforces semantic versioning for all published packages and makes sure every exposed value or type has some documentation and type annotations.
local usbWatcher = nil | |
-- This is our usbWatcher function | |
-- lock when yubikey is removed | |
function usbDeviceCallback(data) | |
-- this line will let you know the name of each usb device you connect, useful for the string match below | |
hs.notify.show("USB", "You just connected", data["productName"]) | |
-- Replace "Yubikey" with the name of the usb device you want to use. | |
if string.match(data["productName"], "Yubikey") then | |
if (data["eventType"] == "added") then |
-- Inspired by Linux alt-drag or Better Touch Tools move/resize functionality | |
function get_window_under_mouse() | |
-- Invoke `hs.application` because `hs.window.orderedWindows()` doesn't do it | |
-- and breaks itself | |
local _ = hs.application | |
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition()) | |
local my_screen = hs.mouse.getCurrentScreen() |
Ref : stackoverflow
The best solution in my opinion is to use the unittest
[command line interface][1] which will add the directory to the sys.path
so you don't have to (done in the TestLoader
class).
For example for a directory structure like this:
new_project
├── antigravity.py
local events = hs.uielement.watcher | |
watchers = {} | |
function init() | |
appsWatcher = hs.application.watcher.new(handleGlobalAppEvent) | |
appsWatcher:start() | |
-- Watch any apps that already exist | |
local apps = hs.application.runningApplications() |
package com.novoda.espresso; | |
import android.os.SystemClock; | |
import android.test.ActivityInstrumentationTestCase2; | |
import com.mypackage.EntryPointActivity; | |
public class EspressoInstrumentationTestCase extends ActivityInstrumentationTestCase2<EntryPointActivity> { | |
private SystemAnimations systemAnimations; |
FROM google/golang | |
RUN go get github.com/tools/godep | |
RUN go get github.com/bmizerany/assert | |
ADD . /gopath/src/github.com/bitly/nsq | |
RUN godep get github.com/bitly/nsq/... | |
RUN cd /gopath/src/github.com/bitly/nsq && godep restore |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.drawable.Drawable; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
public class ForegroundImageView extends ImageView { | |
private Drawable foreground; |