Skip to content

Instantly share code, notes, and snippets.

View roxeteer's full-sized avatar

Visa Kopu roxeteer

View GitHub Profile
console.log('test.js loaded');
setTimeout(() => {
var a = document.querySelector('xyz');
console.log('test.js triggered', a);
a.style.background = 'red';
}, 10000);
const arc = require('@architect/functions');
const { DateTime } = require('luxon');
const { createPost } = require('@architect/shared/ghost_post');
async function route(req, res) {
const { GHOST_NAME } = process.env;
let post
try {
const got = require('got');
// When using Architect framework, you can share code between functions
// Read the documentation at https://arc.codes/guides/sharing-common-code
const { getGhostToken } = require('@architect/shared/ghost_auth');
async function createPost(postData) {
const { GHOST_NAME } = process.env;
const tokenData = await getGhostToken();
const got = require('got');
const querystring = require('querystring');
async function getGhostToken() {
const { GHOST_NAME, GHOST_USER, GHOST_PASS, GHOST_CLIENT_ID, GHOST_CLIENT_SECRET } = process.env;
const headers = {
'Content-Type': 'application/x-www-form-urlencoded'
};

Keybase proof

I hereby claim:

  • I am roxeteer on github.
  • I am roxeteer (https://keybase.io/roxeteer) on keybase.
  • I have a public key ASCkfApozNBE8hVYMSKWGzGG4OMReS6NgRMIdnAKZi4bFQo

To claim this, I am signing this object:

var restify = require('restify');
// create server instance
var server = restify.createServer();
// configure middleware
server.use(restify.bodyParser());
server.use(restify.CORS());
// TODO: configure routes here
x Event Description Referral Traffic (Visits) Visitors Weekly test Media orders
1388534400000 323.00 8684.00 8296.49
1388620800000 180.00 9152.00 8296.49
1388707200000 180.00 9420.00 41878.05
1388793600000 180.00 8824.00 8296.49
1388880000000 252.00 8880.00 8296.49
1388966400000 108.00 8562.00 0.0
1389052800000 216.00 9742.00 0.0
1389139200000 72.00 9740.00 0.0
1389225600000 36.00 9446.00 0.0
x Referral Traffic (Visits) Visitors Weekly test Media orders
2014-01-01 323.00 8684.00 8296.49
2014-01-02 180.00 9152.00 8296.49
2014-01-03 180.00 9420.00 41878.05
2014-01-04 180.00 8824.00 8296.49
2014-01-05 252.00 8880.00 8296.49
2014-01-06 108.00 8562.00 0.0
2014-01-07 216.00 9742.00 0.0
2014-01-08 72.00 9740.00 0.0
2014-01-09 36.00 9446.00 0.0
x Referral Traffic (Visits) Visitors Weekly test Media orders
2014-08-30 0.0
2014-08-31 327.00 7695.00 0.0
2014-09-01 365.00 10281.00 0.0
2014-09-02 297.00 9568.00 0.0
2014-09-03 382.00 9409.00 0.0
2014-09-04 348.00 9101.00 0.0
2014-09-05 297.00 7815.00 0.0
2014-09-06 170.00 6301.00 0.0
2014-09-07 293.00 7489.00 0.0
@roxeteer
roxeteer / float_separators.js
Last active December 13, 2015 22:28
JavaScript: Add thousands separators
// add separators to any kind of a number
function sep(val) {
if (!val) return val;
var s = val + "",
components = s.split("."),
x = components[0].split("");
for (var i = x.length - 3; i > 0; i -= 3) {
x.splice(i, 0, ",");