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
// it just study code... | |
const axios = require('axios'); | |
module.exports = { | |
/** | |
* check url file health. if request return 40X code, then chacker return false. | |
* @param {string} targetUrl target url string | |
* @param {object} headerInfo header info | |
* @returns {object} return object {result : (boolean)fileHealth, info : (object)headerInfo} |
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 readLineSync = require('readline-sync'); | |
var userInput = [], | |
menuText = []; | |
function getUserInput() { | |
// get user input text | |
for(let consoleLine of menuText) { | |
userInputData.push(readLineSync.question(consoleLine)); | |
} | |
} |
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
{ | |
"user" : "{{USER_NAME}}", | |
"userPW" : "{{USER_PASSWORD}}", | |
"host" : "{{DB_HOST}}", | |
"dbName" : "{{DB_NAME}}", | |
"port" : "{{PORT}}" | |
} |
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 System; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace fileChecker | |
{ | |
internal class Program | |
{ | |
public static void Main(string[] args) |
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
private string getValueFromDict(ConcurrentDictionary<string, ConcurrentDictionary<string, string>> source, string keyValue, string subKeyValue) | |
{ | |
string result = null; | |
ConcurrentDictionary<string, string> sourceValueObject; | |
source.TryGetValue(keyValue, out sourceValueObject); | |
sourceValueObject.TryGetValue(subKeyValue, out result); | |
return result; | |
} |
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
import os | |
def changeFilePath(file_path): | |
os.chdir(file_path) | |
def readFile(file_name) : | |
file_data = [] | |
file_object = open(file_name, 'r') | |
while True: | |
line_value = file_object.readline() |
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
// filePath ex) C:\Users\User_name\Desktop\0000.dds | |
private System.Drawing.Image getConvertImageToDDS(string filePath) | |
{ | |
try | |
{ | |
//see https://github.com/nickbabcock/Pfim | |
Pfim.IImage pfImage = Pfim.Pfim.FromFile(filePath); | |
Bitmap pic = new Bitmap(pfImage.Width, pfImage.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); | |
Rectangle rect = new Rectangle(0, 0, pfImage.Width, pfImage.Height); |
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
// 1. console log | |
var tile_3000 = { id : 'id_1', count : 20, vt : true}; | |
var tile_4000 = { id : 'id_2', count : 40, vt : true}; | |
var tile_5000 = { id : 'id_3', count : 30, vt : false}; | |
// print object name | |
// set css | |
console.log('========= css =============='); |
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 convertSize(fileSize, fixed) { | |
var sizeName = ['Byte','KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB']; | |
var sizeOffset = Math.round((fileSize.toString().length / 4)); | |
var sizeReduceArray = [fileSize] | |
for(var loopCountNum = 0; loopCountNum < sizeOffset; loopCountNum++){ | |
sizeReduceArray.push(1024); | |
} | |
const size = sizeReduceArray.reduce((acc, cur) => acc / cur).toFixed(fixed); | |
return `${size} ${sizeName[sizeOffset]}`; |
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
private Bitmap convertImageToBitmap(Image targetImage) | |
{ | |
Rectangle m_Rect = new Rectangle(0, 0, targetImage.Width, targetImage.Height); | |
Bitmap pic = new Bitmap(targetImage.Width, targetImage.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); | |
byte[] imageData = convertImageToByteArray(targetImage); | |
lock (targetImage) | |
{ | |
System.Drawing.Imaging.BitmapData bmpData = pic.LockBits( | |
m_Rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, | |
pic.PixelFormat |
OlderNewer