This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getBillableHours = function(projectId) { | |
function sumTimes(times) { | |
let billableHours = 0; | |
for(let time of times) { | |
billableHours += parseFloat(time.hours); | |
} | |
return billableHours; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var negabinaryApp = angular.module('negabinaryApp', []); | |
negabinaryApp.filter('negabinary', function() { | |
return function (decimal) { | |
if (isNaN(decimal)) return "not a number"; | |
var negabinary = []; | |
var base = -2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": "airbnb", | |
"plugins": [ | |
"react" | |
], | |
"rules": { | |
"max-len": [2, 122], | |
"comma-dangle": [0], | |
"react/jsx-closing-bracket-location": [1, "tag-aligned"] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Touchscreen Test</title> | |
<style> | |
body { | |
text-align: center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// libraries | |
const express = require('express'); | |
const https = require('https'); | |
const fs = require('fs'); | |
const cors = require('cors'); // Cross-Origin Resource Sharing | |
// setup express | |
const app = express(); | |
app.use(cors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getURL(startMatch, endMatch, str) { | |
var regex = new RegExp(startMatch + ': (.+), ' + endMatch); | |
var contents = str.split(regex)[1]; | |
return contents ? contents : 'none found'; | |
} | |
var str = 'website: http://www.google.com, soundcloud: http://www.soundcloud.com, facebook: http://www.facebook.com, stage: the main one'; | |
console.log('Website URL:', getURL('website', 'soundcloud', str)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scrypt = require('scrypt-async'); | |
const nacl = require('tweetnacl'); | |
nacl.util = require('tweetnacl-util'); | |
// utility functions | |
// ----------------- | |
function printStage(stage) { | |
console.log(stage); | |
console.log('-'.repeat(stage.length)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using jQuery | |
$("#2020data").submit(function(e) { | |
$.ajax({ | |
url: "https://e0d92634.ngrok.io/test", | |
type: "POST", | |
data: new FormData(this), | |
processData: false, | |
contentType: false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const querystring = require('querystring'); | |
const keys = require('../config/keys'); | |
const getAccessToken = async refreshToken => { | |
try { | |
const accessTokenObj = await axios.post( | |
'https://www.googleapis.com/oauth2/v4/token', | |
querystring.stringify({ | |
refresh_token: refreshToken, |