This file contains hidden or 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
import { promises as fs } from 'fs'; | |
import * as path from 'path' | |
import { authenticate } from '@google-cloud/local-auth'; | |
import { gmail_v1, google } from 'googleapis' | |
import { JSONClient } from 'google-auth-library/build/src/auth/googleauth'; | |
import { OAuth2Client } from 'google-auth-library'; | |
const SCOPES = ['https://mail.google.com/']; | |
// The file token.json stores the user's access and refresh tokens, and is | |
// created automatically when the authorization flow completes for the first |
This file contains hidden or 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 db = mongoose.connect('mongodb://localhost:27017/DB'); | |
// In middleware | |
app.use(function (req, res, next) { | |
// action after response | |
var afterResponse = function() { | |
logger.info({req: req}, "End request"); | |
// any other clean ups |
This file contains hidden or 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
#!/usr/bin/env zsh | |
if [[ -z "$1" ]] then | |
# Update to cd into the dir of your organization folder/dir | |
DIR=~/source | |
else | |
DIR="$1" | |
fi | |
CURRENT_DIR=`pwd` |
This file contains hidden or 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
=IF(LEN(REGEXREPLACE(IF(LEN(SUBSTITUTE(AL1," ","")) = 11,SUBSTITUTE(AL1," ",""),""),"^0","+234")) = 14,REGEXREPLACE(IF(LEN(SUBSTITUTE(AL1," ","")) = 11,SUBSTITUTE(AL1," ",""),""),"^0","+234"),AL1) |
This file contains hidden or 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
'use strict'; | |
var goalState = [1, 2, 3, 4, 5, 6, 7, 8,0]; | |
var startTime, | |
endTime, | |
counter = 100, | |
counted = 0, | |
checked = 0, | |
goalMap = {}, | |
size, |
This file contains hidden or 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
'use strict'; | |
var goalState = [0, 1, 2, 3, 4, 5, 6, 7, 8]; | |
var hash = {}, | |
openList = [], | |
startTime, | |
endTime, | |
solved = false, | |
steps = 0, | |
counter = 100, |
This file contains hidden or 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
'use strict'; | |
var endTime, | |
startTime, | |
counted = 0, | |
counter = 1000, | |
allSuc = [], | |
hash = {}, | |
values = new Array(1000000), | |
size = 0; |
This file contains hidden or 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 totalSecInAClock = 24 * 60 * 60 | |
function cal (sec) { | |
var hours = Math.floor(sec / 3600); | |
var minutes = Math.floor((sec - (3600 * hours)) / 60); | |
var seconds = Math.floor((sec - (3600 * hours))) % 60; | |
return { | |
hours: hours, | |
minutes: minutes, | |
seconds: seconds | |
} |