Skip to content

Instantly share code, notes, and snippets.

View drborges's full-sized avatar
🏠
Working from home

Diego Borges drborges

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python
from flask import Flask, render_template, Response
import cv2
import time
import io
import threading
import picamera
class Camera(object):
#!/usr/bin/env python
import cv2
import time
from flask import Flask, render_template, Response
# emulated camera
# from camera import Camera
# Raspberry Pi camera module (requires picamera package)
names := rivers.FromData("Diego", "Hernando", "Bianca")
ages := rivers.FromData(30, 29, 21)
combined := rivers.Combine(myCustomCombiner, []*rivers.Pipeline{
names,
ages,
})
grep :: S.ByteString -> FilePath -> IO ()
grep pattern file = withFile file ReadMode $ \h -> do
is <- Streams.handleToInputStream h >>=
Streams.lines >>=
Streams.filter (S.isInfixOf pattern)
os <- Streams.unlines Streams.stdout
Streams.connect is os
List<Integer> transactionsIds =
transactions.parallelStream()
.filter(t -> t.getType() == Transaction.GROCERY)
.sorted(comparing(Transaction::getValue).reversed())
.map(Transaction::getId)
.collect(toList());
type Employee struct {
appx.Model
Name string
Area string
Role string
}
func ScheduleManagersOrDirectorsUSMeeting(context appengine.Context) {
employeesByArea := datastore.NewQuery("Employee").Filter("Area =", "US")
err :=appx.NewDatastore(context).Query(employeesByArea).
func main() {
messages := make(chan string, 2)
messages <- "Hello "
messages <- "World!"
msg1 := <- messages
msg2 := <- messages
print(msg1)
print(msg2)
package main
import (
"fmt"
"github.com/drborges/demo-app/go/sweet"
"net/url"
)
var (
SessionURL = "https://github.com/session"
public interface Movable {
public void moveTo(Point position);
}
public class Car implements Movable {
public void moveTo(Point position) {
// Omitted code
}
}
package main
import logger from log
// Function inline definition
fn hello(name string) string = "Hello {name}"
// Pattern matching
fn fib(n int) int = match n {
case n < 0: panic("Negative values not allowed")