This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import ( | |
Any, | |
Dict, | |
Generic, | |
Literal, | |
Optional, | |
Tuple, | |
TypeVar, | |
) | |
from wireup import DependencyContainer, container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import authentication = require('feathers-authentication'); | |
const jwt = require('feathers-authentication-jwt'); | |
const local = require('feathers-authentication-local'); | |
const extractJWT = jwt.ExtractJwt; | |
import { Application } from 'feathers'; | |
import { Request } from 'express'; | |
// !! This service is different than the default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Conditionally pass line or file data to jq. | |
# | |
# First argument is a filter override to jq, default is '.' | |
# Second argument is a file, otherwise stdin is used | |
JQ_FILTER=${1:-'.'} | |
while read line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cli, { InputQuestion, ListQuestion } from "inquirer"; | |
interface TypeSafeInput< | |
TValidatedInput, | |
TName extends string | |
> extends InputQuestion<{ [name in TName]: TValidatedInput }> { | |
type: "input"; | |
name: TName; | |
message: string; | |
typePredicate: (input: any) => input is TValidatedInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Promise = require('bluebird'); | |
const Sequelize = require('sequelize'); | |
const fs = Promise.promisifyAll(require('fs')); | |
const _ = require('lodash'); | |
const sequelize = new Sequelize(connectionString, { | |
dialect: 'mysql', | |
logging: false, | |
pool: { // application-side connection pool configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* TYPESCRIPT */ | |
import { Injectable } from '@angular/core'; | |
@Injectable() | |
export class ResponsiveService { | |
constructor() { | |
window.onresize = this.callSubscribers | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type KEY = string | number | symbol; | |
interface Dictionary<K extends KEY, V> { | |
getKeys(): K[]; | |
getValues(): V[]; | |
get(key: K): V | null; | |
put(key: K, val: V): void; // or boolean? | |
} | |
class JSDict<K extends KEY, V> implements Dictionary<K, V> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2" | |
services: | |
app: | |
image: crccheck/hello-world | |
restart: always | |
networks: | |
- web | |
- default | |
expose: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CLIENT | |
import feathers from '@feathersjs/feathers' | |
import socketio from '@feathersjs/socketio-client' | |
import auth from '@feathersjs/authentication-client' | |
import io from 'socket.io-client' | |
const socket = io('http://localhost:3030') | |
const app = feathers() | |
// Set up Socket.io client with the socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContinueOnSuccess { | |
items = []; | |
length = 0; | |
constructor(newItems) { | |
this.items = newItems; | |
length = this.items.length; | |
} |
NewerOlder