Skip to content

Instantly share code, notes, and snippets.

@safe1981
safe1981 / index.html
Created January 17, 2013 00:29
A CodePen by Erhan Başa. Facebook Nerby Concept - Facebook responsive grid and layout system. It's not for money, it's just html practice and fun. Responsive Update: 12.01.2013 Old problem: It's now min-width 600. Max-width 600, other pages and functions coming soon. Author : Erhan Basa http://www.erhanbasa.com/facebooknewconcept.html Desginer :…
<!DOCTYPE html>
<html>
<head>
<title>Facebook Fred Nerby Concept - For Practice</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/custom.js"></script>
</head>
<body>
<div id="container">
@safe1981
safe1981 / Gist를 이용한 소스관리.markdown
Last active February 23, 2019 04:55
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 플러그인 설치

@safe1981
safe1981 / jquery_plugin.js
Created March 15, 2012 05:30
javascript: jquery plugin작성 시에 기본으로 적용하는 초기 구조
//플러그인 작성기법
//window, document와 같은 전역변수를 굳이 넘기는 이유
//1. Local변수에 캐싱하여 효과를 높이는 효과
//2. 코드 압축 수행시 효과적으로 압축가능 window=>a. document=>b 등
//undefined를 마지막에 쓰는 이유, 악의적으로 undefined변조가능
(function( $, window, document, undefined ) {
$.fn.queryTwitter = function() {
console.log("test");
};
})( jQuery, window, document );
@safe1981
safe1981 / object_create_polyfill.js
Created March 15, 2012 06:15
Javascript: Object.create를 지원하지 않는 브라우저를 위한 Polyfill
//Polyfill for browsers that don't support Object.create
if ( typeof Object.create !== 'function' ) {
Object.create = function ( obj ) {
function F();
F.prototype = obj;
return new F();
}
}
@safe1981
safe1981 / prevent_crashing.js
Created March 15, 2012 05:26
Javascript: jQuery $사인 crash를 막는 방법
(function( $ ) {
$.fn.queryTwitter = function() {
console.log("test");
};
})( jQuery );
@safe1981
safe1981 / gist:2035301
Created March 14, 2012 09:16
Javascript: 어떤코드
<span>Span</span>
<p>Paragraph</p>
<div>Div</div>
<table style="color:inherit;">
<tr>
<td>Table</td>
</tr>
</table>
@safe1981
safe1981 / pubsub.js
Created March 13, 2012 04:20
Javascript: Pub/Sub Design pattern (Observer Pattern)
var PubSub = {}; //create empty object!
(function(p){
"use strict";
var topics = {},
lastUid = -1;
var publish = function( topic , data){
@safe1981
safe1981 / gist:2016613
Created March 11, 2012 14:28 — forked from paulirish/gist:1928551
draft of lazyweb-requests summary

TODO

  • defer and footnotes
  • mothereffinganimgif huge success
  • api.h5p huge success
  • big IRC client effort
@safe1981
safe1981 / gist:2016608
Created March 11, 2012 14:25 — forked from paulirish/gist:1928551
draft of lazyweb-requests summary

TODO

  • defer and footnotes
  • mothereffinganimgif huge success
  • api.h5p huge success
  • big IRC client effort

12 months ago, I opened up a repo on Github; the idea was that my ideas were great and I didn't have time to complete them all, so I wrote them for other people to do. (lol) In reality, all of us have way more time than ideas, but it turned out some of the ideas I had were totally shared by other people, we just didn't have a meeting place to collaborate.