Skip to content

Instantly share code, notes, and snippets.

View raycon's full-sized avatar

Raegon Kim raycon

View GitHub Profile
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@jongyeol
jongyeol / legacy_articles.js
Created March 17, 2012 12:23
for legacy article' permalink of Jong10.com
// for legacy articles' permalink.. -_-
var old_articles =
{78:8,88:10,96:17,112:25,133:28,153:30,158:34,159:35,160:36,162:43,
165:45,169:47,181:51,190:55,198:65,206:70,222:74,226:79,228:81,231:86,
232:87,234:89,235:91,236:94,237:108,238:110,239:111,241:113,243:115,246:116,
247:119,250:121,252:122,253:123,254:125,255:127,256:132,257:133,258:134,260:137,
261:139,262:140,267:145,268:147,269:150,270:151,271:152,273:154,274:156,276:160,
277:162,278:163,279:165,281:166,282:167,283:168,284:170,287:171,289:173,290:174,
291:176,294:180,295:181,296:182,297:184,298:185,299:186,300:187,302:189,304:190,
305:191,306:192,307:193,308:226,309:227,310:228,312:229,313:230,314:231,315:232,
@izeye
izeye / CountingSorter.java
Created February 17, 2012 16:42
Counting Sort (Java Version)
public class CountingSorter implements Sorter {
private final int maxValue;
public CountingSorter(int maxValue) {
this.maxValue = maxValue;
}
@Override
public int[] sort(int[] values) {
int[] counts = new int[maxValue + 1];
@brennen
brennen / .vimrc
Created December 13, 2011 07:53 — forked from averyvery/.vimrc
Tweaked Vim minimap
function! ToggleMinimap()
if exists("s:isMini") && s:isMini == 0
let s:isMini = 1
else
let s:isMini = 0
end
if (s:isMini == 0)
@brajeshwar
brajeshwar / wordpress-post-thumbnail-or-first-image-or-default.php
Created September 9, 2011 10:23
Wordpress - Get the Image from Post Thumbnail or the First Image of a post or else use a default Image.
/*
* Display Image from the_post_thumbnail or the first image of a post else display a default Image
* Chose the size from "thumbnail", "medium", "large", "full" or your own defined size using filters.
* USAGE: <?php echo my_image_display(); ?>
*/
function my_image_display($size = 'full') {
if (has_post_thumbnail()) {
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id, $size);
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))