This file contains hidden or 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
| // s3 버킷 생성은 콘솔에서 진행 | |
| // (이름이 전역적으로 고유해야 함) | |
| // IAM 사용자 만들고 엑세스 키 생성하여 연결 (AmazonS3FullAccess 권한 줘야 함) | |
| // https://artiiicy.tistory.com/16 | |
| const { S3Client, AbortMultipartUploadCommand, PutObjectCommand, GetObjectCommand } = require("@aws-sdk/client-s3"); | |
| const fs = require('fs') | |
| const path = require('path'); | |
| require('dotenv').config() | |
| const bucketName = "yubs87-testbucket" | |
| const express = require('express') |
This file contains hidden or 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
| package com.example.test | |
| import androidx.appcompat.app.AppCompatActivity | |
| import android.os.Bundle | |
| import android.util.Log | |
| import java.io.* | |
| class MainActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) |
This file contains hidden or 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 flatObjToArray(o) { | |
| return Object.keys(o).sort().reduce(function (r, k) { | |
| if(typeof o[k] !== "object") return r.concat(k, o[k]); | |
| else return r.concat(k, flatObjToArray(o[k])); | |
| }, []); | |
| } | |
| // 전달되는 함수는 모두 결정적인 함수라고 가정 | |
| function cache(f, thisContext = null) { | |
| const cached = new Map(); |
This file contains hidden or 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
| pragma solidity ^0.4.24; | |
| import "./ERC20Interface.sol"; | |
| import "./SafeMath.sol"; | |
| contract MyToken is ERC20Interface { // 계약 선언 | |
| using SafeMath for uint; | |
| string public constant name = "MyToken"; // 토큰명 | |
| string public constant symbol = "MTK"; // 토큰 기호 | |
| uint8 public constant decimals = 18; // 소수점 수 |
This file contains hidden or 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
| pragma solidity ^0.4.21; | |
| contract Escrow{ | |
| uint public value; | |
| address public seller; | |
| address public buyer; | |
| string public message; | |
| enum State {Created, Locked, Sent, Complete} | |
| State public state; | |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or 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
| #include "stdafx.h" | |
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| // 사이즈 5이지만 4개만 저장되는 이유!? -> null terminator 저장 때문 | |
| // 따라서 저장할 문자가 n개면 사이즈는 n+1로 잡기 | |
| char *buf = new char[6]; | |
| cin.get(buf, 6); |
This file contains hidden or 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
| @echo off | |
| SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe | |
| rem add it for all file types | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
| rem add it for folders | |
| @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f |
This file contains hidden or 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
| def mysplit(target): | |
| tuples = [] | |
| prev = target[0] | |
| count = 1 | |
| for idx, c in enumerate(target[:-1]): | |
| if prev != target[idx+1]: | |
| tuples.append((prev, count)) | |
| count = 1 | |
| else: |
This file contains hidden or 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 ddf.minim.*; | |
| import ddf.minim.analysis.*; | |
| Minim minim; | |
| AudioPlayer player; | |
| AudioMetaData meta; | |
| BeatDetect beat; | |
| int r = 200; | |
| float rad = 70; | |
| void setup() |
NewerOlder