Skip to content

Instantly share code, notes, and snippets.

View romgrk's full-sized avatar
♥️
hey

Rom Grk romgrk

♥️
hey
View GitHub Profile
'use strict';
/*
* Execution
*/
var repo = getRepository()
var users = repo.addGroup('users', ['firstName', 'lastName', 'email'])
log(repo.listGroups()) // => ['users']
/** Sends an email.
* Usage:
var message = {
server: 'smtp.office365.com',
port: 25, // Don't include the port if you are targeting office365
username: '[email protected]',
password: 'secret',
usessl: true, // Set to true if you are targeting office365
headers: { 'X-Custom': 'value' }
from: '[email protected]',
@romgrk
romgrk / service-worker-browser.js
Last active April 4, 2017 16:12
Caches everything
/*
* main.js
* Copyright (C) 2016 romgrk <romgrk@Romgrk-ARCH>
*
* Distributed under terms of the MIT license.
*/
'use strict';
const serviceWorker = navigator.serviceWorker;
/*
* jscript.js
*/
'use strict';
/*
* Workflow
*/
function get(name) { return Watch.getVariable(name); }
// Sends a GET request to the workflow
const sendWorkflowRequest = (config, method, params) => {
return new Promise((resolve, reject) => {
// Construct request options
var options = {
host: config.urls.planetPress,
port: config.urls.planetPressPort,
path: `/${method}?${querystring.stringify(params)}`,
method: 'GET'
};
var Service = require('node-windows').Service;
var appPath = require('path').join(__dirname,'\\bin\\www');
// Create a new service object
var svc = new Service({
name:'PlanetPress NodeJS API',
description: 'PlanetPress API service for quote and orders Web interface.',
script: appPath
});
/*
* tag_metadata_pagecount.js
*
* Set each metadata document 'ExtraData' field to its page count.
*/
extendArray()
/*
* Retrieve the auth_token, then make the REST call to retrieve the content sets.
@romgrk
romgrk / rest.js
Last active January 27, 2017 17:17
/*
* rest.js
*/
var api = new RestAPI('ol-admin', 'secret')
var contentSets = api.contentsets.list()
log(contentSets)
#s Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted provided the copyright notice and this notice are preserved.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
# TERM entries {{{
TERM Eterm
'use strict';
((function() {
var exports = {};
window.cotg = exports;
Object.defineProperty(exports, "__esModule", {
value: true
});
/*