Skip to content

Instantly share code, notes, and snippets.

View SungjinYoo's full-sized avatar

Sungjin Yoo SungjinYoo

  • Amazon
  • Vancouver
View GitHub Profile
//
// main.c
// minishell
//
// Created by SungJinYoo on 11/7/14.
// Copyright (c) 2014 SungJinYoo. All rights reserved.
//
#include <libgen.h>
//
// command.c
// minishell
//
// Created by SungJinYoo on 11/10/14.
// Copyright (c) 2014 SungJinYoo. All rights reserved.
//
#include "command.h"
#include <string.h>
#!/bin/bash
#==============================================================================
# GW-Kit
# @author : (origin) yunsang.choi([email protected])
# @author : (forked) jinkwon([email protected])
# @src : (origin) https://gist.github.com/gists/3115022
# @src : (forked) https://github.com/Jinkwon/naver-gw-kit/
#-------
@SungjinYoo
SungjinYoo / tistory_sample.py
Created November 8, 2018 01:01
tistory gist import sample
def __name__ == "__main__":
print("Hello World!")
@SungjinYoo
SungjinYoo / SampleFunctionalInterface.java
Last active November 13, 2018 11:18
Sample functional interface definition
interface SampleFunctionalInterface {
// I am the only abstract method in this interface
int foo();
}
interface AnotherSampleFunctionalInterface {
// I am the only abstract method in this interface
int foo();
@SungjinYoo
SungjinYoo / SampleNonFunctionalInterface.java
Created November 13, 2018 11:12
Sample non functional interface definition
interface SampleNonFunctionalInterface {
// there are two abstract methods!
int foo();
int bar();
}
interface Consumer<T> {
void accept(T value);
}
// create Consumer by defining a class explicitly
class HelloWorldPrinter implements Consumer<String> {
public void accept(String name) {
System.out.println("Hello World! " + name);
}
interface Function<T, R> {
R apply(T value);
}
// a function that returns the same type with the input type
Function<Integer, Integer> square = (num) -> {
return num * num;
}
System.out.println(square.apply(3)); // prints out 9
@FunctionalInterface
interface Printer {
void print(String value);
}
class TextPrinter implements Printer {
void print(String value) {
System.out.println(value);
}
}