Skip to content

Instantly share code, notes, and snippets.

Avatar
🎹
Focusing

Bohyung kim dsdstudio

🎹
Focusing
View GitHub Profile
@dsdstudio
dsdstudio / sha512.java
Last active Feb 7, 2021
java sha-512 encryption
View sha512.java
/**
* sha512 방식으로 암호화한 스트링을 리턴한다
*
* @param target
* @return [encrypted string]
*/
public final static String encryptSHA512(String target) {
try {
MessageDigest sh = MessageDigest.getInstance("SHA-512");
sh.update(target.getBytes());
@dsdstudio
dsdstudio / logback.xml
Created Jan 25, 2016
logback rollingfileappender + gzip compression
View logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- debug=true 해주는이유는 설정이 잘못되었는지 미리 판단이 가능하기 때문이다 -->
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>
View locale.swift
do{
let c = try NSString(contentsOfFile: path, encoding: CFStringConvertEncodingToNSStringEncoding(0x0422))
print(c)
} catch {
fatalError(error.localizedDescription)
}
@dsdstudio
dsdstudio / Apple_mobile_device_types.txt
Created Dec 22, 2019 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
View Apple_mobile_device_types.txt
i386 : iPhone Simulator
x86_64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
iPhone5,1 : iPhone 5 (GSM)
@dsdstudio
dsdstudio / jwt.java
Created Nov 30, 2019
jwt token create and validation
View jwt.java
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
class Scratch {
@dsdstudio
dsdstudio / JQPrefixGeneratorStrategy.java
Created May 14, 2019
jooq jpa entity로 부터 뽑아내기
View JQPrefixGeneratorStrategy.java
import org.jooq.codegen.DefaultGeneratorStrategy;
import org.jooq.meta.Definition;
public class JQPrefixGeneratorStrategy extends DefaultGeneratorStrategy {
@Override
public String getJavaClassName(Definition definition, Mode mode) {
return "JQ" + super.getJavaClassName(definition, mode);
}
}
@dsdstudio
dsdstudio / ff2cv.cpp
Created Feb 23, 2019 — forked from yohhoy/ff2cv.cpp
Read video frame with FFmpeg and convert to OpenCV image
View ff2cv.cpp
/*
* Read video frame with FFmpeg and convert to OpenCV image
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>
@dsdstudio
dsdstudio / t0.md
Last active Oct 19, 2018
Rails request body gzip deflate
View t0.md

Rails5.x config/initializers/mime_types.rb

Mime::Type.register "gzip/json", :gzipjson

ActionDispatch::Http::Parameters::DEFAULT_PARSERS[:gzipjson] = lambda do |raw_body|
  body = ActiveSupport::Gzip.decompress(raw_body)
  JSON.parse(body)
end
@dsdstudio
dsdstudio / README.md
Created Oct 13, 2018 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X
View README.md

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@dsdstudio
dsdstudio / ipojo.gradle
Last active Oct 1, 2018
gradle -> felix-ipojo bytecode manipulation
View ipojo.gradle
apply plugin: "osgi"
apply plugin: "java"
apply plugin: "maven"
version = "0.0.1"
buildscript {
repositories {
mavenCentral()
}