Skip to content

Instantly share code, notes, and snippets.

var data = {
header: {
"x-request-id": "1"
},
"body": {
"guid": "1234",
"items": [
{
"name": "item1",
"quantity": {"num": [{value: 100, data: "A"}, {value: 101, data: "A1"}], "numStr": "hundread"}
package subscription.refresh.manager.task;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import slack.sender.service.SlackService;
import stamp.common.utils.DateTimeUtil;
@kimyongin
kimyongin / json_postgres.js
Last active September 19, 2021 10:48 — forked from lucdew/json_postgres.js
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
@kimyongin
kimyongin / crop and rotate image.ipynb
Last active May 5, 2020 13:18
crop and rotate image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
'use strict'
// This & Binding (Implicit, Explicit, Hard, New) & Arrow Function (Lexical Scope)
// -------------------------------------------------------------------------------
// [1.기본 바인딩] hello(thing) 은 hello.call(this, thing) 의 syntactic sugar 이다.
console.log("[1]")
function hello(thing) {
console.log(this + " hello " + thing);
}
<!doctype html>
<html>
<head>
<title>Rich Text Editor</title>
<script type="text/javascript">
var oDoc, sDefTxt;
function initDoc() {
oDoc = document.getElementById("textBox");
sDefTxt = oDoc.innerHTML;
import StoreKit
public typealias ProductIdentifier = String
public typealias ProductsRequestCompletionHandler = (_ success: Bool, _ products: [SKProduct]?) -> ()
open class IAPHelper: NSObject {
// MARK: - Properties
fileprivate let productIdentifiers: Set<ProductIdentifier>
public var purchasedProducts = Set<ProductIdentifier>()
import UIKit
import StoreKit
class ProductCell: UITableViewCell {
static let priceFormatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.formatterBehavior = .behavior10_4
formatter.numberStyle = .currency
package Chapter8.testing.Ex04
import Chapter8.testing.{Gen, RNG, State, Stream}
import Gen._
import Prop._
case class SimpleRNG(seed: Long) extends RNG {
override def nextInt: (Int, RNG) = {
val newSeed = (seed * 0x5DEECE66DL + 0xBL) & 0xFFFFFFFFFFFFL
val nextRNG = SimpleRNG(newSeed)
package Chapter07.Parallelism.Ex02
import java.util.concurrent._
object Par {
private case class UnitFuture[A](get: A) extends Future[A] {
def isDone = true
def get(timeout: Long, units: TimeUnit) = get
def isCancelled = false