Skip to content

Instantly share code, notes, and snippets.

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

German Viscuso germanviscuso

🏠
Working from home
View GitHub Profile
@germanviscuso
germanviscuso / example-query.js
Created April 4, 2020 23:30 — forked from thetrevorharmon/example-query.js
Query JSON with S3 Select in Node.js
// See tth.im/s3json for a full explanation of this code
const AWS = require('aws-sdk');
const S3 = new AWS.S3();
exports.handler = async (_, context) => {
try {
const query = 'SELECT * FROM s3object[*].results[*] r;';
// test query is against data from https://swapi.co/api/planets/?page=2
@germanviscuso
germanviscuso / en-US.js
Created August 13, 2019 10:33 — forked from KayLerch/en-US.js
Optimized i18n request interceptor for Alexa custom skills in Node. Loads only required language assets from external files and provides some convenient functions to read them. Will also let you store localized settings represented as JSON objects in your language files.
module.exports = Object.freeze({
translation: {
welcome: 'Howdy',
images: [
{
background: 'https://image/en-US.png'
},
{
background: 'https://image/en-US2.png'
},
function supportsDisplay(handlerInput) {
// returns true if the skill is running on a device with a display (Echo Show, Echo Spot, etc.)
// Enable your skill for display as shown here: https://alexa.design/enabledisplay
return handlerInput.requestEnvelope.context &&
handlerInput.requestEnvelope.context.System &&
handlerInput.requestEnvelope.context.System.device &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces.Display &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces.hasOwnProperty('Alexa.Presentation.APL');
}
using UnityEngine;
using System;
using System.Collections.Generic;
/// <summary>
/// A console that displays the contents of Unity's debug log.
/// </summary>
/// <remarks>
/// Developed by Matthew Miner (www.matthewminer.com)
/// Forked by Joseph Cassano (jplc.ca) from Console to ConsoleInGame so the console can work from other scripts.
using Norm;
using Norm.Responses;
using Norm.Collections;
using Norm.Linq;
public class MongoSession {
private Mongo _server;
MongoQueryProvider _provider;
public MongoSession() {
using Db4objects.Db4o;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Web;
public class DB4OServer {
IObjectServer _server;
public DB4OServer() {
using Db4objects.Db4o;
using Db4objects.Db4o.Linq;
using System.Collections.Generic;
using System.Configuration;
public class Db4oSession : IDisposable {
private IObjectContainer db;
public Db4oSession(IObjectContainer container) {
db = container;
using Db4objects.Db4o;
using System.Linq;
using Db4objects.Db4o.Linq;
using System.Web;
using System.IO;
using System;
using System.Collections.Generic;
namespace NoSQL {