Skip to content

Instantly share code, notes, and snippets.

View seungwoonlee's full-sized avatar
🎯
Focusing

winCloud seungwoonlee

🎯
Focusing
View GitHub Profile
@seungwoonlee
seungwoonlee / HelloAndroidActivity.java
Last active December 12, 2015 09:09
Simple Android onClick()
public void onClick(View v) {
if (v.getId() == R.id.Button01) { // if you pressed the 'Button01'
finish(); // finish this Activity
}
}
@seungwoonlee
seungwoonlee / SimpleLockScreen.java
Last active October 16, 2021 03:08
Simple Android LockScreen
package com.example.lockscreen;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Toast;
@seungwoonlee
seungwoonlee / UserInputActivity.java
Created February 10, 2013 18:51
Android UserInput Logging
package com.example.userinput;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
public class UserInputActivity extends Activity {
@seungwoonlee
seungwoonlee / MainActivity.java
Last active December 12, 2015 09:39
Android Gallery Image Selector
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
intent.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, 0);
@seungwoonlee
seungwoonlee / gist:5148456
Created March 13, 2013 00:43
Android Rescan Media forcibly
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));
@seungwoonlee
seungwoonlee / choco-install-package.bat
Created April 20, 2018 02:18 — forked from lesstif/choco-install-package.bat
chocolatey 로 패키지 설치
@ECHO ON
REM install choco
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
REM utility
choco install chocolatey-core.extension -y
choco install 7zip -y
choco install sysinternals -y
choco install procexp -y
@seungwoonlee
seungwoonlee / chocolatey-env-setup.ps1
Created April 20, 2018 02:20 — forked from amogram/chocolatey-env-setup.ps1
A Chocolatey script for PowerShell I use to set up my Windows development environment. I use this when setting up my own Dev VMs. Use at your own risk.See http://bit.ly/1a301JK and http://chocolatey.org/ for more information.
# Simple environment setup script
# Install Applications
choco install fiddler4
choco install notepadplusplus
choco install visualstudiocode
choco install greenshot
choco install GoogleChrome
choco install putty
choco install ccleaner
@seungwoonlee
seungwoonlee / change-ubuntu-mirror.sh
Created April 22, 2018 12:20 — forked from lesstif/change-ubuntu-mirror.sh
우분투의 apt 기본 미러를 다음 카카오로 변경
#!/bin/sh
SL=/etc/apt/sources.list
cp ${SL} ${SL}.org
##
sed -e 's/\(us.\)\?archive.ubuntu.com/ftp.daumkakao.com/g' -e 's/security.ubuntu.com/ftp.daumkakao.com/g' < ${SL}.org > ${SL}
## check
@seungwoonlee
seungwoonlee / rename_file.py
Last active January 16, 2019 10:28
python file rename example
import os
def rename_movie_file(path, check_str):
for filename in os.listdir(path):
file_name, file_ext = os.path.splitext(filename)
file_ext = file_ext.lower()
if file_ext == '.md':
if check_str in filename:
file_name = file_name.replace(check_str, "")
rename_filename = file_name + file_ext
@seungwoonlee
seungwoonlee / re-test1.py
Created April 19, 2019 08:27
한글 날짜 문자열을 dateutil.parser.parse() 에서 사용하기 위해서 간단 정규식 활용
import re # 정규식(Regular Expression)
str = '2019-04-19 오후 1:50:39' # 2019-04-19 1:50:39 PM 로 바꾸고 싶다. dateutil.parser.parse()를 사용하기 위해서
list = re.split('오후 ', str) # '오후 '를 str에서 찾아서 둘로 쪼개어 각각을 list에 넣는다. 오후 다음에 Space가 있음에 유의
print(list)
newstr = list[0] + list[1] + ' PM'
print(newstr)