Skip to content

Instantly share code, notes, and snippets.

@wafe
wafe / convertTime.js
Created November 9, 2023 06:49 — forked from g1eb/convertTime.js
Convert seconds to a human readable representation
export function convertTime(seconds) {
var seconds = parseInt(seconds, 10)
var hours = Math.floor(seconds / 3600)
var minutes = Math.floor((seconds - (hours * 3600)) / 60)
var seconds = seconds - (hours * 3600) - (minutes * 60)
if ( !!hours ) {
if ( !!minutes ) {
return `${hours}h ${minutes}m ${seconds}s`
} else {
return `${hours}h ${seconds}s`
@wafe
wafe / excel_xml_spreadsheet_example.md
Created January 4, 2023 03:47 — forked from ilyazub/excel_xml_spreadsheet_example.md
Excel 2003 XML Spreadsheet example

Excel 2003 XML Spreadsheet example

Example

image

spreadsheet.xml

Solved errors

Problem During Load because of wrong ss:ExpandedRowCount.

@wafe
wafe / 한글과유니코드.md
Created August 9, 2019 06:14 — forked from Pusnow/한글과유니코드.md
한글과 유니코드

한글과 유니코드

유니코드에서 한글을 어떻게 다루는지를 정리하였다.

유니코드

  • 유니코드(Unicode)는 전 세계의 모든 문자를 컴퓨터에서 일관되게 표현하고 다룰 수 있도록 설계된 산업 표준 (위키 백과)
  • 단순히 문자마다 번호를 붙임
  • 계속 업데이트되며 현재는 Unicode Version 9.0.0 이 최신이다.

UTF

  • 유니코드를 실제 파일 등에 어떻게 기록할 것인지를 표준화한 것이다.
@wafe
wafe / 0_Readme.md
Last active December 28, 2020 10:25
node.js Buffer 클래스 발표 시 사용한 코드

node.js 스터디에서 Buffer 클래스에 대해 발표할 때 사용한 코드입니다.

발표 내용은 YouTube 에 올렸습니다. (YouTube 동영상 링크)

@wafe
wafe / Import-PfxCertificate.ps1
Last active April 28, 2020 20:56 — forked from deadlydog/Import-PfxCertificate.ps1
PowerShell script that imports a .pfx certificate file. To install pfx certificate on IIS
param($PfxFilePath, $Password)
$absolutePfxFilePath = Resolve-Path -Path $PfxFilePath
Write-Output "Importing store certificate '$absolutePfxFilePath'..."
Add-Type -AssemblyName System.Security
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($absolutePfxFilePath, $Password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags] "MachineKeySet, PersistKeySet")
$store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist "MY", LocalMachine
$store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::"ReadWrite")
@wafe
wafe / MongoQueue.php
Created February 2, 2020 14:22
Jenssegers/Mongodb attempts bug fixed
<?php
# vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Queue/MongoQueue.php
namespace Jenssegers\Mongodb\Queue;
use Carbon\Carbon;
use Illuminate\Queue\DatabaseQueue;
use Jenssegers\Mongodb\Connection;
use MongoDB\Operation\FindOneAndUpdate;
class MongoQueue extends DatabaseQueue
@wafe
wafe / gist:2000145
Created March 8, 2012 10:16
node.js uncaughtException logging using winston
var winston = require('winston'); // https://github.com/flatiron/winston
var logger = new (winston.Logger)({
transports: [
new (winston.transports.Console)(),
new (winston.transports.File)({ filename : 'winston.log', timestamp: true, /*maxsize: 2000, maxFiles: 5*/ })
]
});
process.on('uncaughtException', function (err) {

Keybase proof

I hereby claim:

  • I am wafe on github.
  • I am heejoonlee (https://keybase.io/heejoonlee) on keybase.
  • I have a public key whose fingerprint is 4FCF EF86 AB85 BD2B 445A 9546 B30B 9758 B00A 0AE2

To claim this, I am signing this object:

@wafe
wafe / code.cs
Last active December 29, 2016 14:09
dotnet 4.5 System.Uri Problem
string url1 = "http://localhost/contents/?registered_date_from=2016-12-26T15%3A00%3A00.000Z&registered_date_to=2016-12-27T15%3A00%3A00.000Z&keywords=%EA%B3%84%ED%9A%8D%EC%84%9C";
string url2 = "http://localhost/contents/?registered_date_from=2016-12-26T15%3A00%3A00.000Z&registered_date_to=2016-12-27T15%3A00%3A00.000Z";
var uri1 = new Uri(url1);
var uri2 = new Uri(url2);
Console.WriteLine(uri1.PathAndQuery);
Console.WriteLine(uri2.PathAndQuery);
/* 쿼리 스트링의 구성에 따라서(현상으로는 UTF-8 한글이 인코딩된 쿼리스트링이
@wafe
wafe / C# php Serializer.cs
Last active July 25, 2016 12:37 — forked from xiangwan/C php Serializer.cs
C# php Serializer
/// <summary>
/// Serializer Class.
/// </summary>
public class PhpSerializer
{
//types:
// N = null
// s = string
// i = int