Skip to content

Instantly share code, notes, and snippets.

View irrationnelle's full-sized avatar
🎯
Focusing

irrationnelle irrationnelle

🎯
Focusing
View GitHub Profile
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}
@irrationnelle
irrationnelle / Gist를 이용한 소스관리.markdown
Last active August 29, 2015 14:27 — forked from safe1981/Gist를 이용한 소스관리.markdown
Article:Gist와 Sublime을 이용한 Code Snippet관리

#Gist를 이용한 코드조각관리 이번 글에서는 Code Snippet이라 불리는 코드조각을 효과적으로 어떻게 관리할 수 있을까에 대한 하나의 방법을 논하고자 한다. 개발을 진행하다보면 무수히 많은 코드를 작성하게 된다. 때때로 작성한 코드 중의 일부를 나중에도 활용해보기 위해 코드를 분류한다. 대체로 이런 경우 자신만의 메모장을 활용하거나, 자주 사용하는 에디터를 활용해서 이를 관리하는 경향이 있다. 하지만 이런 방법은 코드가 많아질수록 검색하기가 쉽지 않고, 개발언어에 따라 효율적으로 코드를 관리하기도 어렵다. 또한 개발하는 IDE환경에서도 손쉽게 사용할 수 없으며, 사무실/집 등, 여러 장소에서 동일하게 사용하는 것도 불가능하다. (물론 Dropbox)와 같은 클라우드 서비스를 활용하면 어느정도 다양한 환경에서 활용가능하지만 이 방법은 회사와 같이 보안 상의 이유로 서비스가 막혀 있는 곳에서는 제대로 적용이 불가능한 문제가 발생한다.

많은 웹사이트 조사를 통해 다양한 Snippet관리 서비스를 찾아봤지만, 그 중에서 개발에 가장 유용한 방식은 GitHub에서 제공하는 Gist라는 서비스를 이용하는 것이었다. 따라서 본 세션에서는 Gist를 이용한 Snippet관리 방식을 알아보고자 한다. 또한 최근 각광받고 있는 Sublime Text에서 Gist플러그인을 활용하여 어떻게 효율적으로 개발Editor와 함께 사용할 수 있는지도 알아보고자 한다.

#Gist환경 셋팅

Github 회원가입

Gist 사용을 위해서는 GitHub 회원가입을 한다. Github는 매우 유명하고 널리 퍼져있는 서비스이므로 서비스가 중단될 걱정을 하지 않고 사용할 수 있다. 외국사이트이니만큼 회원정보도 과도하게 요구하지 않는다.

Sublime에 Gist 플러그인 설치

@irrationnelle
irrationnelle / item.xml
Last active September 22, 2015 11:15
itemContent
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageview"
@irrationnelle
irrationnelle / ReadUserName_for_malloc.c
Created October 20, 2015 11:54
Using malloc function to input each name infos in dynamic allocation
#include <stdio.h>
#include <stdlib.h>
char * ReadUserName(void)
{
char * name = (char *)malloc(sizeof(char)*30);
printf("What's your name?: ");
gets(name);
return name;
}
#ifndef LINKEDLIST_H // To avoid repeating header declaration
#define LINKEDLIST_H // With this line, codes can be valid from 3 to 26
#include <stdio.h>
#include <stdlib.h>
typedef int ElementType;
typedef struct tagNode
{
@irrationnelle
irrationnelle / SLL_InsertAfter_MY_ERROR.c
Created November 2, 2015 19:08
I just thought that this function need only current node's pointer which point NewNode, but NewNode also need current node's pointer which point former NextNode.
void SLL_InsertAfter(Node* Current, Node* NewNode)
{
Node* Tail = Current;
Tail->NextNode = NewNode;
}
@irrationnelle
irrationnelle / SLL_InsertHead_MY_ERROR.c
Created November 4, 2015 13:31
I did not declare and substitude NewHead, I just made 'NewHead->NextNode' point former Head's tail node.
void SLL_InsertHead(Node** Head, Node* NewHead)
{
if((*Head) == NULL)
*Head = NewHead;
else
{
NewHead->NextNode = (*Head)->NextNode;
*Head = NULL;
}
}
@irrationnelle
irrationnelle / SLL_RemoveNode_MY_ERROR.c
Created November 5, 2015 09:33
I missed the condition in sentence 'while', that is 'Tail != NULL'. But I can not understand why I must add this condition sentence...
void SLL_RemoveNode(Node** Head, Node* Remove)
{
if((*Head)==NULL)
*Head = Remove->NextNode;
else
{
Node* Tail = *Head
while(Tail->NextNode != Remove)
{
Tail = Tail->NextNode;
@irrationnelle
irrationnelle / SLL_GetNodeAt_MY_ERROR.c
Created November 5, 2015 11:31
I used 'for loop' for finding certain Node, but my condition must be added 'Tail != NULL' in if statement. But I don't understand why I should use this condition.
Node* SLL_GetNodeAt(Node* Head, int location)
{
int i;
Node* Tail = *Head;
for(i=0; i<location; i++)
{
Tail=Tail->NextNode;
}
return Tail;