Skip to content

Instantly share code, notes, and snippets.

View saegeullee's full-sized avatar

saegeullee saegeullee

View GitHub Profile
@saegeullee
saegeullee / adventOfCode4.ts
Last active November 16, 2024 04:15
Advent of Code 4번 문제
type Attribute = 'byr' | 'iyr' | 'eyr' | 'hgt' | 'hcl' | 'ecl' | 'pid' | 'cid';
type Passport = {
byr: string;
iyr: string;
eyr: string;
hgt: string;
hcl: string;
ecl: string;
pid: string;
cid?: string;
@saegeullee
saegeullee / adventOfCode3.ts
Last active November 15, 2024 17:19
Advent of Code 3번 문제
function part1(input:string):number {
const lines:string[] = input.split('\n');
lines.shift();
lines.pop();
const x:number = lines[0].length;
const y:number = lines.length;
const array:string[][] = [];
@saegeullee
saegeullee / adventOfCode2.ts
Last active November 15, 2024 17:18
Advent of Code 2번 문제
function part1(input: string):number {
const lines:string[] = input.split('\n');
let result:number = 0;
for(const line of lines) {
if(line === "") continue;
const infos = line.split(' ');
const min:number = parseInt(infos[0].split('-')[0]);
@saegeullee
saegeullee / example3.js
Created February 15, 2021 06:19
tagmanager3
function purchaseFunc() {
// ... purchase logic ...
const purchaseTag = {
dataLayer: {
event: 'purchase',
name: data.orderName,
price: data.totalPaymentPrice,
@saegeullee
saegeullee / example2.js
Created February 15, 2021 06:08
tagmanager
import TagManager from 'react-gtm-module';
function purchaseFunc() {
// ... purchase logic ...
const purchaseTag = {
dataLayer: {
event: 'purchase',
name: data.orderName,
@saegeullee
saegeullee / example.js
Last active February 15, 2021 06:09
tagmanager1
import TagManager from 'react-gtm-module';
function signInFunc() {
//...singIn logic...
const signinTag = {
dataLayer: {
event: 'login',
method: method,
@saegeullee
saegeullee / django_cheat_sheet.md
Created October 9, 2019 17:40 — forked from bradtraversy/django_cheat_sheet.md
Django command cheat sheet

Django 2.x Cheat Sheet

Creating a virtual environment

We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder

python -m venv ./venv
//------LoginActivty.java--------
package com.example.android.foodrecipes;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
def BubbleSort(li):
list_length = len(li)
#length가 4라면
#바깥 루프는 3번 돌아야 하므로
#range()는 0, 1, 2까지 즉 range(3)이 되야 하므로
#range(list_length-1)이 되어야 한다.
for i in range(list_length-1):
#안쪽 루프는 1번당 3-> 2-> 1
class Retailer:
price_of_computer = 100000
price_of_computer_from_vendor = 50000
def __init__(self, money, product, place):
self.money = money
self.product = product
self.place = place