Skip to content

Instantly share code, notes, and snippets.

View QuadFlask's full-sized avatar
🌴
wanna go vacation

QuadFlask

🌴
wanna go vacation
  • Seoul, Korea
View GitHub Profile
@QuadFlask
QuadFlask / CircularProgressDrawable.java
Last active April 16, 2017 22:04 — forked from castorflex/CircularProgressDrawable.java
self color change by color list
package com.example.android.sunshine.app;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
@QuadFlask
QuadFlask / index.html
Created July 7, 2015 12:53
andorid search unsupport device list
<!DOCTYPE html>
<html ng-app="unsupportDeviceSearchApp">
<head>
<title>기기 미지원 리스트</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
</head>
<body ng-controller="unsupportDeviceSearchController">
<form>
<input type="text" ng-model="query" ng-change="search()">
</form>
@QuadFlask
QuadFlask / SimpleObjectAnimatorTest.java
Created July 21, 2015 13:16
Simple slide object animator
private static final Interpolator INTERPOLATOR = new LinearInterpolator();
private static int DURATION = 300;
private Property<View, Float> translateProperty = new Property<View, Float>(Float.class, "translateX") {
@Override
public Float get(View view) {
return view.getTranslationX();
}
@QuadFlask
QuadFlask / cdefine.md
Last active December 30, 2015 04:00
replace all #define to inline in js

`gcc -E -x c source.js | sed '/^#/d' > result.js``

@QuadFlask
QuadFlask / xD-Arrays for dimmies
Created February 29, 2016 01:37
[CodeWras] xD-Arrays for dimmies
http://www.codewars.com/kata/5402724fd39b43c075000116/train/javascript
```javascript
function fill(n, x) {
var a = [];
for(var i=0;i<n;i++) {
if (typeof x === 'function') a[i] = x();
else if(x instanceof Array) a[i] = x.slice(0);
else a[i] = x;
}
@QuadFlask
QuadFlask / main.rs
Created March 17, 2016 11:46
러스트 튜토리얼 따라하기
extern crate rand; // Cargo.toml 에 정의한 디팬던시를 가져오기 위해 extern crate 키워드로 가져오기
use std::io; // 임포트
use std::cmp::Ordering;
use rand::Rng;
fn main() {
println!("Guess the number"); // 기본적으론 함수 호출은 그냥 노말하게 호출, 느낌표는 매크로를 호출
let secret_number = rand::thread_rng().gen_range(1, 101); // 상수에 바인딩.
@QuadFlask
QuadFlask / zigzag.md
Created March 25, 2016 15:26
zigzag problem

(영상)[https://www.youtube.com/watch?v=W23s6kYJbrA]

크롬 콘솔에서만 해보느라(귀찮아서) tdd를 못했넹....

하스켈 좀 공부해서 해보자. recursive, map, filter 가 주 로직이니 쉽게(는 아니고) 가능할거 같다

문제

0   4   8
1 3 5 7 9
@QuadFlask
QuadFlask / undoredo.md
Last active March 28, 2016 14:47
[CodeWars] Undo/Redo

link

function undoRedo(object) {
  function History(type, key, oldValue, newValue) {
    this.type = type;
    this.key = key;
    this.oldValue = oldValue;
    this.newValue = newValue;
@QuadFlask
QuadFlask / observedPin.md
Created March 28, 2016 16:39
[CodeWars] The observed PIN

넘버 키패드에서 가능한 조합 찾기

  • 후보 숫자들이 주어지고
  • 각 숫자의 상하좌우의 번호가 후보군이됨
  • 이 후보군들의 모든 조합들을 찾기

MySolution

var np = [['1','2','3'],['4','5','6'],['7','8','9'],[null,'0',null]];

function getPINs(observed) {
@QuadFlask
QuadFlask / sudoku.md
Created March 29, 2016 13:46
[CodeWars] 스도쿠 벨리데이터

http://www.codewars.com/kata/529bf0e9bdf7657179000008/train/javascript;

처음에는 합이 45가 나오니까 합을 모두 계산해서 해볼까...

했다가 그럴필요 없이 각 로우/컬럼/3x3박스에 1~9가 모두 들어있으면 되겠다 해서 이렇게 했는데;;

그냥 숫자가 모두 있다를 체크하는게 나을거 같아서 그냥 해봄;;

var hasAll = (arr) =&gt; arr.reduce((a,b)=&gt;a+b)==45