Skip to content

Instantly share code, notes, and snippets.

@JCSooHwanCho
JCSooHwanCho / FileIO.swift
Last active May 6, 2024 10:49
ps할 때 입력을 한꺼번에 받기 위한 유틸리티 클래스. fread의 swift 버전.
import Foundation
final class FileIO {
private let buffer:[UInt8]
private var index: Int = 0
init(fileHandle: FileHandle = FileHandle.standardInput) {
buffer = Array(try! fileHandle.readToEnd()!)+[UInt8(0)] // 인덱스 범위 넘어가는 것 방지
@SamLeatherdale
SamLeatherdale / stan-watchlists.js
Created August 23, 2020 10:31
Import/export Stan Watchlists
// Wrap in IIFE for repeated usage
(function () {
const WATCHLISTS = {}; // Once exported, replace {} with your exported watchlist object
const ACTION = "import"; // or export
function getJwToken() {
const tokenEl = document.querySelector('[href*="jwToken"]');
const href = tokenEl.getAttribute("href");
const url = new URL(href);
return url.searchParams.get("jwToken");
@i-e-b
i-e-b / reset.txt
Created April 2, 2021 07:03
To reset "Dino World" Secret diary kid's toy
To reset dino world secret diary, hold 1, 3, and 0 together until it opens (about 3 seconds)
then enter new 4 digit code and press #

Var vs. Let

This Gist was automatically created by Carbide, a free online programming environment.

[You can view a live, interactive version of this Gist here](

Arrow functions

@kopecmi8
kopecmi8 / cell0.js
Last active May 6, 2024 10:46
template literals
var person = {
name: 'Michal',
surname: 'Kopecký',
}
var greetings = 'Hi, ' + person.name + ' ' + person.surname + '!';

Classes

@kopecmi8
kopecmi8 / cell0.js
Last active May 6, 2024 10:45
extended parameter handlling
function createProduct(price, productNumber, name, description) {
return {
price: price,
code: productNumber,
name: name,
desc: description
}
}
function discountCreateProduct(price, ...params) { ///tady se jedná o rest parameter