Skip to content

Instantly share code, notes, and snippets.

View Beomi's full-sized avatar

Junbum Lee Beomi

View GitHub Profile
@Beomi
Beomi / deploy.json
Last active March 19, 2017 14:29
Fabric for Django Deploy
{
"REPO_URL":"",
"PROJECT_NAME":"",
"REMOTE_HOST_SSH":"",
"REMOTE_HOST":"",
"REMOTE_USER":"",
"REMOTE_PASSWORD":""
}
@Beomi
Beomi / cap.sh
Last active March 26, 2017 15:41
Upload capture for GoogleDrive
#!/bin/bash
# 1st Install https://github.com/prasmussen/gdrive
# then use this script in Alfred or from CLI when you want to screenshot then upload to your gdrive
# then share the link to others from your paste board
# (run gdrive one first time to authenticate with Google)
screencapture -tpng -i /tmp/temp_shot_gdrive.png
DATEFILENAME=`date +"%Y%m%d%H%M"`
# use -p id to upload to a specific folder
# parser.py
import requests
# 로그인할 유저정보를 넣어주자 (모두 문자열)
LOGIN_INFO = {
'email': '[email protected]',
'pw': 'aaa124',
'proc': 'login',
'returnUrl': '',
'witnessMe': '1'
@Beomi
Beomi / deploy.json
Last active April 25, 2020 13:30
DjangoGirls Tutorial Seoul Workshop fabric3 : fabfile.py
{
"REPO_URL":"깃헙Repo주소",
"PROJECT_NAME":"프로젝트폴더(settings.py가있는 폴더)의 이름",
"REMOTE_HOST":"여러분이 만든 도메인주소(ex: djangogirls-seoul-tutorial.tk )",
"REMOTE_USER":"django",
"STATIC_ROOT":"static",
"STATIC_URL":"static",
"MEDIA_ROOT":"media"
}
import binascii
from datetime import datetime
def chunkstring(string, length):
return (string[0+i:length+i] for i in range(0, len(string), length))
# Open in binary mode (so you don't read two byte line endings on Windows as one byte)
# and use with statement (always do this to avoid leaked file descriptors, unflushed files)
with open('hexdata.txt', 'r') as f:
@Beomi
Beomi / WhatIsDoubleEM.md
Created July 10, 2017 13:22
우아한 테크캠프 2주 1일차 과제: `map`/`filter`구현하기 | 어쩌다 JS는 JS가 되었나 | `!!`은 무엇인가

!!은 무엇인가?


JS에서의 !

JavaScript에서 !not의 의미이고, Bool 연산시 true -> false, false -> true로 변환해준다.

그리고 특정한 값 혹은 객체는 false와 동등하게 취급된다. 즉, if구문의 조건의 결과로 나올 경우 '', null, undefined, []등은 false로 취급되는 것이다.

우아한 테크캠프 웹트랙 2주차 1일 과제

Map, Filter같이 동작하는 함수 구현

// map function
const mapFunction = (array, func) => {
    const new_array = []
    for (i of array) {
        new_array.push(
@Beomi
Beomi / iam_policy.json
Created August 1, 2017 00:52
Serverless Framework iam settings for AWS
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:CreateStack",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResources",
@Beomi
Beomi / troller.py
Created December 9, 2017 05:53
파이썬 2017 연말 세미나 트롤러
import requests
import time
from multiprocessing import Pool
def troll(_):
with requests.Session() as s:
s.headers = {
'DNT': '1',
'Accept-Encoding': 'gzip, deflate',
@Beomi
Beomi / lambda_function.py
Last active June 3, 2018 17:46
NexonTalk 20180605: DeepLearning with CNN on AWS Lambda
import torch #파이토치
import torchvision.datasets as vdatasets #데이터셋 모음
import torchvision.utils as vutils #유틸리티함수
import torchvision.transforms as vtransform #변환함수
import numpy as np #수치연산
import torch.nn as nn
import torch.nn.functional as F
from PIL import Image
from io import BytesIO
import base64