Skip to content

Instantly share code, notes, and snippets.

View pretty00butt's full-sized avatar
🐢
small, slow, and solid

hoony pretty00butt

🐢
small, slow, and solid
View GitHub Profile

Keybase proof

I hereby claim:

  • I am hoonyland on github.
  • I am hoonyland (https://keybase.io/hoonyland) on keybase.
  • I have a public key ASAHT1um0sNMj79978icZh027pcJgLQb0c-xzLuNHN7Kzwo

To claim this, I am signing this object:

@pretty00butt
pretty00butt / cloudSettings
Last active February 7, 2022 02:23
new-macbook-vscode-settings
{"lastUpload":"2022-02-07T02:23:22.073Z","extensionVersion":"v3.4.3"}
@pretty00butt
pretty00butt / integration_test.rs
Last active December 11, 2019 12:53
unit test & integration test in Rust
// tests/integration_test.rs
use adder;
mod common;
#[test]
fn add_two_test() {
common::setup();
assert_eq!(adder::add_two(2), 4);
WEBVTT
1
00:00:10.180 --> 00:00:19.000
<ruby>規制<rt>きせい</rt></ruby>された<ruby>視界<rt>しかい</rt></ruby><ruby>無慈悲<rt>むじひ</rt></ruby>なる
2
00:00:19.000 --> 00:00:26.920
<ruby>十<rt>じゅう</rt></ruby><ruby>二<rt>に</rt></ruby>の<ruby>支配<rt>しはい</rt></ruby><ruby>逃<rt>のが</rt></ruby>れられない

An Ansible summary

Patterns

  • all (or *)
  • hostname: foo.example.com
  • groupname: webservers
  • or: webservers:dbserver
  • exclude: webserver:!phoenix
  • intersection: webservers:&amp;staging
@pretty00butt
pretty00butt / index.js
Created February 1, 2018 04:48
React를 위한 JavaScript 기초
/**
* 1. let과 const의 차이
*/
let num1 = 1;
const num2 = 3;
num1 = 3;
// 성공
num2 = 4;
@pretty00butt
pretty00butt / promise-series.js
Last active December 12, 2017 11:13
Promise.series - Synchronous version of Promise.all
const PromiseSeries = (arr) => {
if (arr.length > 1) {
const target = arr[0]
const rest = arr.slice(1)
return target.then(() => PromiseSeries(rest))
} else {
return arr[0]
}
}
@pretty00butt
pretty00butt / asyncronous.js
Created November 14, 2017 13:10
Callback & Promise
// 1. Great!
for (var i = 0; i < 10; i++) {
console.log(i);
}
console.log('done');
// 2. Stupid!
for (var i = 0; i < 10; i++) {
setTimeout(function() {
console.log(i);
import request from 'superagent'
import AppDispatcher from '../AppDispatcher'
import * as types from '../constants'
import APIS from '../../../apis'
export default {
validateCurrentToken: function (options = {}) {
const currentToken = window.localStorage.getItem('TOKEN')
const ProtectedComponent = ({ Component, path }) => {
switch (this.state.token) {
case '':
return <DefaultLayout path={path} Component={LoadingContainer} />
case 'UNAUTHORIZED':
return <Redirect to="/login" />
default:
return <DefaultLayout path={path} component={Component} />
}
}