Skip to content

Instantly share code, notes, and snippets.

View newmind's full-sized avatar
🎯
Focusing

JG newmind

🎯
Focusing
View GitHub Profile
@newmind
newmind / find_and_delete_console.md
Created September 4, 2019 00:48
Find & delelte all files older than 30 days recursively on Linux console

find all files older than 30 days recursively in current directory

find ./ -type f -mtime +30

Variation 1 - find all files older than 30 days that end with .log

find ./ -name "*.log" -type f -mtime +30

Variation 2 - delete all files older than 30 days that end with .log

@newmind
newmind / bestAlbum.java
Last active April 25, 2019 03:37
map sortByValue and Tuple<Integer, Integer>
package kr.co.programmers.hash;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
package bestalbum;
@newmind
newmind / sortByKeyOrValue.java
Created April 24, 2019 15:59
sort map key or value
public class TestSort {
public static void main() {
//메인메소드에서 구현
Map<Double,Integer> hashMap = new HashMap<Double,Integer>();
hashMap.put(1.1,99);
hashMap.put(2.2,70);
hashMap.put(13.3,89);
hashMap.put(7.7,79);
hashMap.put(10.1,99);
{
"Envelope" : {
"WARC-Header-Length" : "578",
"Block-Digest" : "sha1:YHKQUSBOS4CLYFEKQDVGJ457OAPD6IJO",
"Format" : "WARC",
"Actual-Content-Length" : "43428",
"WARC-Header-Metadata" : {
"WARC-Record-ID" : "<urn:uuid:ffbfb0c0-6456-42b0-af03-3867be6fc09f>",
"WARC-Warcinfo-ID" : "<urn:uuid:3169ca8e-39a6-42e9-a4e3-9f001f067bdf>",
"Content-Length" : "43428",
@newmind
newmind / loader.html
Created March 7, 2018 06:14 — forked from bellbind/loader.html
[threejs][html5]STL File Viewer with HTML5 File API
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>STL File Viewer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"
></script>
<script src="https://rawgit.com/mrdoob/three.js/master/examples/js/controls/TrackballControls.js"
></script>
<script src="loader.js"></script>
https://jsbin.com/katopurimo/1/edit?html,css,js,output
@newmind
newmind / backend-architectures.md
Created November 5, 2017 16:27 — forked from ngocphamm/backend-architectures.md
Backend Architectures
@newmind
newmind / FibFrog.py
Created November 4, 2017 15:37
1. FibFrog - Count the minimum number of jumps required for a frog to get to the other side of a river.
#
# https://codility.com/demo/results/trainingDHFPPW-Y4E/
# https://codesays.com/2014/solution-to-fib-frog-by-codility/
def solution(A):
# add frog's starting position to A
A.insert(0, 1)
# add frog's destination position to A
A.append(1)
@newmind
newmind / Ladder.py
Last active October 30, 2017 13:58
1. Ladder - Count the number of different ways of climbing to the top of a ladder.
# 100 / 100%
# https://codility.com/demo/results/training4JY7ZG-7BK/
def solution(A, B):
# write your code in Python 2.7
fib_end = max(A) + 2
fib = [0] * fib_end
fib[1] = 1
for i in xrange(2, fib_end):
@newmind
newmind / ways.py
Created October 30, 2017 10:08 — forked from anonymous/ways.py
def ways(N, Memo):
print 'N', N, Memo
if N < 0: return 0
if N in Memo:
return Memo[N]
else:
Memo[N] = N+1
if N == 1:
Memo[N] += 1