Skip to content

Instantly share code, notes, and snippets.

View euoia's full-sized avatar

James Pickard euoia

  • https://www.greendragonbungay.co.uk
  • Bungay, Suffolk, England
View GitHub Profile
@euoia
euoia / gist:aa6d3a58476c98f047bb
Last active December 23, 2020 22:41
Basic Node.js .gitignore for Mac OS X
##########################
# Application specfic
##########################
# config/config.js
##########################
# General
##########################
#####
@euoia
euoia / Little Till 2020-07-30-magenta.md
Last active July 30, 2020 13:49
Little Till Release 30 July 2020 [Magenta]

Summary

  • Updates to product page.
  • Interface tweaks.

Details

Table Service

  • The "Web Shop" link now only shows web product lines. To see table orders see the new "Service Dashboard" link.
@euoia
euoia / gist:d7caa6fa8e9b3cede52f4bb2491132e6
Created June 4, 2020 10:24
Appium javascript-webdriverio appium logs
[HTTP] --> POST /session
[HTTP] {"capabilities":{"alwaysMatch":{"platformName":"iOS","automationName":"XCUITest","deviceName":"iPhone SE (2nd generation)","platformVersion":"13.5","app":"/Users/euoia/Code/appium/sample-code/apps/TestApp.app.zip"},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","automationName":"XCUITest","deviceName":"iPhone SE (2nd generation)","platformVersion":"13.5","app":"/Users/euoia/Code/appium/sample-code/apps/TestApp.app.zip"}}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- POST /session 404 1 ms - 50
[HTTP]
[HTTP] --> POST /session
[HTTP] {"capabilities":{"alwaysMatch":{"platformName":"iOS","automationName":"XCUITest","deviceName":"iPhone SE (2nd generation)","platformVersion":"13.5","app":"/Users/euoia/Code/appium/sample-code/apps/TestApp.app.zip"},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","automationName":"XCUITest","deviceName":"iPhone SE (2nd generation)","platformVersion":"13.5","app":"/Users/euoia/Code/appium/sample
# Schema:
Post hasMany Threads
Thread hasMany Comments
# Problem
In this made up example, I'm selecting all posts, threads and comments that
have comments by a particular user. I'm not interested in the other threads, or
the other comments, just the Post data, Thread data and Comments for comments by
this user. In SQL this is easy:
@euoia
euoia / gist:796531f9f4e301ec1a9af18ff70cfb68
Created May 11, 2018 09:47
Overriding error message not working
email = models.EmailField(_("The Candidate's email address"),
max_length=255, unique=True, error_messages={'invalid': 'xxx.'})
#!/usr/bin/env node
const db = require('sqlite');
db.open('tiles.db')
.then(db => db.prepare('select data from TestTable'))
.then(qry => {
const insertAll = () => qry.get().then(row => {
if (!row) {
return;
}
@euoia
euoia / gist:53859b9d664c282978c9
Created November 13, 2015 11:24
Basic ES6 .eslintrc for Node.js
{
"rules": {
"no-console": 0,
"indent": 2,
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
@euoia
euoia / gist:24b272aeeb7c27107b94
Last active October 13, 2016 20:07
Basic ES6 Node.js .tern config
{
"ecmaVersion": 6,
"libs": [
],
"plugins": {
"node": {}
}
}
return Promise.all(queues.map(q => {
return Promise.props({name: q, length: redis.llenAsync(q)});
}));
@euoia
euoia / gist:d3a9419dbaad02fb6dc3
Created March 5, 2016 13:03
A basic .tern-project
{
"libs": [
],
"plugins": {
"node": {}
}
}