Skip to content

Instantly share code, notes, and snippets.

import * as React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { DragAndDropProvider, Draggable, DropView } from '@jgoday/react-native-dragndrop';
const styles = StyleSheet.create({
successMatch: {
color: 'blue',
fontWeight: 'bold',
fontSize: 30,
},
@jgoday
jgoday / main.rs
Created October 23, 2019 10:06
Postgres async notifications with tokio_postgres
#![feature(poll_map)]
use futures::{stream, StreamExt};
use futures::{FutureExt, TryStreamExt};
use std::env;
use tokio::sync::mpsc;
use tokio_postgres::{connect, NoTls};
#[tokio::main]
async fn main() {
let connection_parameters = env::var("DBURL").unwrap();
import * as React from 'react';
import './App.css';
export interface IProps {
}
async function srcToDataUrl(url: string) {
return new Promise<string>(async (resolve, _) => {
const resp = await fetch(url);
@jgoday
jgoday / sample.cpp
Last active August 29, 2015 14:27
lambda and variable arguments in c++11
#include <functional>
#include <iostream>
template<typename T>
void log(T arg)
{
std::cout << arg;
std::cout << std::endl;
}
@jgoday
jgoday / Boot.scala
Last active July 10, 2016 17:37
Slick with lift ( from https://github.com/ggarciajr/slick.git sample )
package bootstrap.liftweb
import net.liftweb._
import util._
import Helpers._
import common._
import http._
import sitemap._
import Loc._