Skip to content

Instantly share code, notes, and snippets.

@niceaji
niceaji / html5_template.html
Created September 27, 2012 10:14 — forked from nathansmith/html5_template.html
Simple HTML5 Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>untitled</title>
<link rel="stylesheet" href="" />
</head>
<body>
@niceaji
niceaji / read_dir.py
Created October 19, 2012 03:07
python-디렉토리내 모든 파일읽기
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
for root, dirs, files in os.walk('folder/path'):
for fname in files:
full_fname = os.path.join(root, fname)
print full_fname
@niceaji
niceaji / ftp_upload.py
Created October 19, 2012 03:10
python-ftp파일업로드
#!/usr/bin/env python
import ftplib
ftp = ftplib.FTP('host','user','password')
fname = "업로드할 파일명(path포함가능"
full_fname = "로컬파일명(path포함가능)"
ftp.storlines('STOR '+ fname, open(full_fname, 'rb'))
ftp.quit()
@niceaji
niceaji / file_get_content.py
Created October 22, 2012 04:34
file_get_content
def file_put_content(filename, content):
f = open(filename, 'w')
f.write(content)
f.close()
def file_get_contents(filename):
return open(filename).read()
#!/bin/bash
function wait_for() {
until $1; do
echo $2
sleep $3
done
}
@niceaji
niceaji / gist:4902327
Created February 13, 2013 02:29
package.json 에서 버전찾기
grep version package.json | sed 's/.*: "\(.*\)".*/\1/'
//http://nodecellar.coenraets.org/
//util.js
window.utils = {
// Asynchronously load templates located in separate .html files
loadTemplate: function(views, callback) {
var deferreds = [];
var modulejs=function(name, source){
var names = name.split(".")
, len = names.length
, context = this
, root = ''
, p='';
if(!source){
return;
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Ates Goral <http://magnetiq.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
var jQuery=function(selector){
return {
addClass : function(){
console.log("addClass()");
return this;
},
css : function(){