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
""" | |
Copies all keys from the source Redis host to the destination Redis host. | |
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are | |
restricted (e.g. on Amazon ElastiCache). | |
The script scans through the keyspace of the given database number and uses | |
a pipeline of DUMP and RESTORE commands to migrate the keys. | |
Requires Redis 2.8.0 or higher. |
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
// | |
// main.c | |
// Question1.4 | |
// | |
// Created by JAE SEUNG KOO on 6/24/15. | |
// Copyright (c) 2015 JAE SEUNG KOO. All rights reserved. | |
// | |
#include <stdio.h> | |
#define LENGTH 18 |
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
// | |
// main.c | |
// InverseNumber | |
// | |
// Created by JAE SEUNG KOO on 7/4/15. | |
// Copyright (c) 2015 JAE SEUNG KOO. All rights reserved. | |
// | |
#include <stdio.h> |
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 moment = require('moment'); | |
function calculateBusinessDays(firstDate, secondDate){ | |
//Initiallize variables | |
var day1 = moment(firstDate); | |
var day2 = moment(secondDate); | |
var adjust = 0; | |
if((day1.dayOfYear() === day2.dayOfYear()) && (day1.year() === day2.year())){ | |
return 0; |
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 requestPromise = require('request-promise'); | |
var _ = require('lodash'); | |
var Promise = require('bluebird'); | |
var GoogleSpreadSheet = require('google-spreadsheet'); | |
var doc = new GoogleSpreadSheet('<GOOGLE_SPREAD_SHEET_ID'); | |
var creds = { | |
"jwt_secret": "", | |
"type": "service_account", |
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 accessKey = pm.environment.get("accessKey") | |
const secret = pm.environment.get("secret") | |
const moment = require('moment'); | |
const timestamp = moment().valueOf(); | |
const message = pm.request.method + " " + pm.request.url.getPath() + "?" + pm.request.url.getQueryString() + "\n" + timestamp + "\n" + accessKey | |
const signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA256(message, secret)); | |
pm.collectionVariables.set("currentTimestamp", timestamp); |