Skip to content

Instantly share code, notes, and snippets.

;;;; Base settings
;; Platform specific variables
(setq windows? (eq system-type 'windows-nt))
(setq mac? (eq system-type 'darwin))
(setq linux? (eq system-type 'gnu/linux))
;; Load path
(unless (boundp 'emacs-dir)(setq-default emacs-dir (if windows?
(concat (getenv "HOMEPATH") "/Dropbox/Dev/emacs.d")
//
// HTSemanticVersion.h
//
// Created by 최건우 on 13. 7. 25..
// Copyright (c) 2013년 Hardtack. All rights reserved.
//
#import "HTVersion.h"
@interface HTSemanticVersion : HTVersion
@Hardtack
Hardtack / ex.py
Created September 16, 2013 06:47
Lexical scope problem
functions = []
for val in ['foo', 'bar', 'baz']:
def f():
return val
functions.append(f)
for func in functions:
print func()
@Hardtack
Hardtack / gist:6545984
Created September 13, 2013 01:43
Print 8
#include <stdio.h>
#include <string.h>
char* f(char *s, int x){return x==81?s:(strcat(s, (x/9%4==0)&&x%9!=8?"*":((((x%9)/8)*8==(x%9))?((x%9)/8==0?"*":"*\n"):" "))&&f(s, ++x))?s:s;}
int main(void) {
char s[91]={0,};
printf("%s",f(s, 0));
}
@Hardtack
Hardtack / Anipang.java
Last active December 17, 2015 18:28
컴퓨터프로그램설계 과제 3
import java.util.Scanner;
public class Anipang {
/* Definitions of Data Structures */
public static final int SIZE = 9;
public static final char[] ITEMS = new char[]{'@','#','%','$'};
public static final int ITEM_SCORE = ITEMS.length;
public static final int WAY_UP = 1;
public static final int WAY_DOWN = 2;
public static final int WAY_LEFT = 3;
@Hardtack
Hardtack / Tetris.java
Last active December 17, 2015 05:39
Tetris for 컴퓨터프로그램설계 quiz
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
public class Tetris {
/* Definitions of Data structures */
public static final boolean O = true;
public static final boolean X = false;
public static final int SIZE = 10;
/**
* Block Bar
@Hardtack
Hardtack / compile.py
Last active December 16, 2015 11:09
Compiles javascript to bookmarklet
import sys
import json
import urllib
import argparse
def request_compile(code):
url = 'http://closure-compiler.appspot.com/compile'
# Encode data
params = urllib.urlencode([
NameError: global name 'l_form' is not defined
(begin
(define
(read-int)
(int (read) Null)
)
(define
(! x)
(if (> x 1)
(* x (! (- x 1)))
@Hardtack
Hardtack / main.m
Last active December 14, 2015 03:19
NSMutableString vs NSMutableArray
//
// main.m
// Time
//
// Created by 최건우 on 13. 2. 24..
// Copyright (c) 2013년 최건우. All rights reserved.
//
#import <Foundation/Foundation.h>