Skip to content

Instantly share code, notes, and snippets.

View Shaun289's full-sized avatar

Sunjong Park Shaun289

View GitHub Profile
@Shaun289
Shaun289 / react-native-app-in-wsl2.kor.md
Last active December 25, 2020 03:53 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2
@Shaun289
Shaun289 / gist:b90069632eec26b50e63770fa532a065
Last active January 6, 2021 00:44
c++ override and overload
class Parent {
public:
virtual void func();
virtual void func(int32_t val);
};
class Child:Parent {
public:
virtual void func();
virtual void func(int32_t val);
@Shaun289
Shaun289 / gist:371df36ddee22901b7a5b78f2aaf57cb
Created January 6, 2021 00:50
c++ switch case error: crosses initialization
enum MODULE_TYPE {
TYPE_A = 0,
TYPE_B,
TYPE_C,
TYPE_D,
TYPE_E,
TYPE_F,
TYPE_G,
TYPE_H,
TYPE_I,
# https://rinthel.github.io/rust-lang-book-ko/ch05-02-example-structs.html
#[derive(Debug)]
struct Rectangle {
width: u32,
height: u32
}
fn main() {
// My first rust program
// UTF-8 character count vs bytes length
// https://shaun289.github.io/2021-05-14-rust_stringlength/
fn string_length(s: &String) -> usize {
s.chars().count()
}
fn main() {
println!("Hello, world!");
@Shaun289
Shaun289 / thread_operator.cpp
Created July 18, 2021 06:43
c++ std::thread with class operator
// Reference : https://snowdeer.github.io/c++/2017/08/18/cpp11-thread-example/
// 함수 객체를 이용하는 방법 #2
#include <iostream>
#include <thread>
#include <chrono>
class A
{
private:
@Shaun289
Shaun289 / while.rs
Last active October 21, 2021 21:38
rust study : while loop
// The rust programming ko https://rinthel.github.io/rust-lang-book-ko/ch03-05-control-flow.html
// compiled on https://play.rust-lang.org/
/* result
*
**
***
****
*****
******
*******
@Shaun289
Shaun289 / unittest.rs
Created October 21, 2021 21:47
rust study : unittest
// The rust programming ko https://rinthel.github.io/rust-lang-book-ko/ch11-01-writing-tests.html
// compiled on https://play.rust-lang.org/
/* result
running 2 tests
test tests::exploration ... ok
test tests::another ... FAILED
failures:
@Shaun289
Shaun289 / for.rs
Created October 21, 2021 22:04
rust study : for loop
// The rust by example ko https://hanbum.gitbooks.io/rustbyexample/content/flow_control/for.html
// compiled on https://play.rust-lang.org/
/* result
1
2
fizz
4
buzz
fizz
7
@Shaun289
Shaun289 / match.rs
Created October 22, 2021 22:24
rust study : match
/*
The rust by example ko https://hanbum.gitbooks.io/rustbyexample/content/flow_control/match.html
compiled on https://play.rust-lang.org/
Notice : exclusive range patterns https://github.com/rust-lang/rust/issues/37854
*/
fn main()
{
for number in 1..22 {
println!("Tell me about {}", number);