Skip to content

Instantly share code, notes, and snippets.

View wmantly's full-sized avatar

William Mantly wmantly

View GitHub Profile

Data access layer

The files in this folder access the database and API's in a standard manner.

  • This is the only place in the project where query's are written and use.
  • No app logic should be used here.
  • Only app.config and app.database should be imported in theses files.
  • These files should only be consumed in the models files.

The files here should be names after tables, collections or API's.

file1.js ======================
console.log('file1 evaluated');
var up = 0
module.exports = {
up: function(){
return ++up;
},
value: function(){
@wmantly
wmantly / config.js
Last active January 25, 2018 20:57
'use strict';
const app = require('../app');
const extend = require('extend');
function load(filePath, required){
try {
return require(filePath);
} catch(error){
if(error.name === 'SyntaxError'){
POST / HTTP/1.1
Host: 10.0.3.54:15000
Content-Type: application/json
Accept-Encoding: gzip, deflate
Content-Length: 15
Connection: keep-alive
Accept: */*
User-Agent: python-requests/2.9.1
{"code": "ls -la"}
# https://gist.github.com/magicrobotmonkey/5300885
sudo apt-get install xserver-xorg-input-mtrack xbindkeys xdotool
sudo mv /usr/share/X11/xorg.conf.d/50-mtrack.conf /usr/share/X11/xorg.conf.d/60-mtrack.conf
sudo service mdm restart
## ~/.xbindkeysrc
"xdotool key ctrl+alt+Right"
b:10
import sqlite3
conn = sqlite3.connect( 'babyorm.db' )
conn.row_factory = sqlite3.Row
c = conn.cursor()
class Model( dict ):
def __init__( self, **kwargs ):
for key, value in kwargs.items():
self[key] = value
https://www.microsoft.com/en-us/accessibility/windows10upgrade?tduid=(14c348e893a91089cb2980533c6ee123)(256380)(2459594)(TnL5HPStwNw-0FBZfNm6YPFXNhiu3o52rA)()
class Node:
''' Object to hold node objects. This class is only used by Linked List and
should not used on its own!
'''
__slots__ = ('data', 'next')
'''By default, instances of classes have a dictionary for attribute storage.
This wastes space for objects having very few instance variables. The space
consumption can become acute when creating large numbers of instances.
https://docs.python.org/3/reference/datamodel.html#slots
i7sky:~/.wine/drive_c/Program Files (x86)/FeudWin Sat Jan 28
10:31 AM william$ wine FeudWin.exe
fixme:heap:HeapSetInformation 0x110000 0 0x33fe00 4
fixme:process:SetProcessDEPPolicy (3): stub
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:advapi:RegisterTraceGuidsW (0x4ee330, 0x2ed59d8, {6a3e50a4-7e15-4099-8413-ec94d8c2a4b6}, 1, 0x2ea8064, (null), (null), 0x2ed59f0,): stub
fixme:userenv:GetProfileType 0x33f4e4
fixme:imm:ImmDisableTextFrameService Stub
fixme:thread:GetThreadPreferredUILanguages 56, 0x33f9dc, (nil) 0x33f9e0
fixme:winsock:WSALookupServiceBeginW (0x33f8b0 0x00000ff0 0x33f8ec) Stub!

You could accomplish this with a NativeExtension for node

You'd have a boostrap.js file that adds a extension handler for .jse files

// register extension
require.extensions[".jse"] = function (m) {