This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import sqlite3 | |
| import datetime | |
| from pymongo import MongoClient | |
| client = MongoClient('mongodb://<USERID>:<PASSWORD>@<HOST>:<PORT>/<DATABASE_NAME>') | |
| db = client['heroku_mr51rc25'] | |
| posts = db['post'] | |
| def dict_factory(cursor, row): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| from flask.ext import restful | |
| from flask.ext.restful import Api | |
| from flask.ext.sqlalchemy import SQLAlchemy | |
| app = Flask(__name__) | |
| app.config.from_object('config') | |
| #flask-sqlalchemy | |
| db = SQLAlchemy(app) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getFirst([test]){ | |
| console.log(test) | |
| } | |
| var arr = ['1','2','3'] | |
| getFirst(arr) // : '1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($){ | |
| $(document).ready(function(){ | |
| var firstGreeting = 'Hello, my new friend there'; | |
| write(firstGreeting); | |
| });//end ready | |
| var write = function(str){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| You need to fill in your API key from google below. Note that querying | |
| supported languages is not implemented. | |
| Language Code | |
| -------- ---- | |
| Afrikaans af | |
| Albanian sq | |
| Arabic ar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.BufferedReader; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.browser = new (function() { | |
| if(jQuery.browser.msie) return jQuery.browser; | |
| else { | |
| var userAgent = navigator.userAgent; | |
| if(!!(userAgent.match(/Trident\/7\./) && userAgent.match(/rv[:]11\./))) { // ie 11 | |
| return {msie:true, version:"11.0"}; | |
| } else { | |
| return jQuery.browser; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data = $form.serializeArray(); | |
| console.log($jq.grep(data, function(e){ return e.name == 'apprTitle'; })); | |
| // Array[1]0: Objectname: "apprTitle"value: "untitled" | |
| //What I expect is empty value.... but it log 'untitled' | |
| //apprTitle catch null | |
| $jq.each(data, function(i,item){ | |
| if(item.name === 'apprTitle'){ | |
| if(item.value === '') item.value= 'untitled'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for /f "tokens=1* delims=" %%a in ('date /T') do set datestr=%%a | |
| mkdir D:\ikep-backup\%datestr% | |
| XCOPY C:\iKEP4-Project\workspace\ikep4 D:\ikep-backup\%datestr% /s /y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.BufferedReader; | |
| import java.io.BufferedWriter; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileReader; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; |
OlderNewer