Skip to content

Instantly share code, notes, and snippets.

//http://nodecellar.coenraets.org/
//util.js
window.utils = {
// Asynchronously load templates located in separate .html files
loadTemplate: function(views, callback) {
var deferreds = [];
@niceaji
niceaji / gist:4902327
Created February 13, 2013 02:29
package.json 에서 버전찾기
grep version package.json | sed 's/.*: "\(.*\)".*/\1/'
#!/bin/bash
function wait_for() {
until $1; do
echo $2
sleep $3
done
}
@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()
@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 / 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 / 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>