Skip to content

Instantly share code, notes, and snippets.

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

Tomas Trescak tomitrescak

🏠
Working from home
  • University of Western Sydney
  • Sydney, Australia
View GitHub Profile
export type FirstArgument<T> = T extends (arg1: infer U, …args: any[]) => any ? U : any;
export interface Query {
notifications: <T = Notification[]>(args: { start?: Int, end?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T>
}
@tomitrescak
tomitrescak / result.ts
Last active July 25, 2018 20:46
Medium - Resolvers
// the types below do all the heavy lifting of making everything type safe
import { Mutation, Notification, Query, Resolver } from './utils';
export const query: Query = {
// hit cmd+space and feel the magic
// params and ctx are type safe, parent and info are 'any'
notifications(_parent, params, ctx, info) {
}
};
@tomitrescak
tomitrescak / Zed.cs
Last active June 6, 2018 05:03
ZED C# Example
using Emgu.CV.Structure;
using sl;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
@tomitrescak
tomitrescak / cloudSettings
Last active August 5, 2018 08:35
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-07-18T07:37:07.603Z","extensionVersion":"v3.0.0"}
@tomitrescak
tomitrescak / index.pl
Created October 10, 2017 11:04
Synology - Auto Index support
#!/usr/bin/perl
#
# Alternative Syno Indexer
# ASI
# release 1
#
# This script will smartly update Media Index on your Synology appliance
# You can create 'noindex' file under scan directory to skip subdir indexing
# Works on DSM 6+
//===========================================================================
//
// Parsing Expression Grammar of Java 1.7 for Mouse 1.1 - 1.6.
// Based on Java Language Specification, Java SE 7 Edition, dated 2012-07-27,
// obtained from http://docs.oracle.com/javase/specs/jls/se7/html/index.html.
//
//---------------------------------------------------------------------------
//
// Copyright (C) 2006, 2009, 2010, 2011, 2013
{
"scripts": {
"start": "node ./server.js | node ./fuse.js"
},
}
const express = require('express');
const app = express();
const historyAPIFallback = require('connect-history-api-fallback');
const SnapHandler = require('luis').handler;
app.use('/snapshot', SnapHandler);
app.use(historyAPIFallback());
// make sure that server.js is in your project root
app.use(express.static('louis'));
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>LUIS - A list of UIS</title>
</head>
<body>