- Rails: https://github.com/rails/pjax_rails
- Django: https://github.com/jacobian/django-pjax
- Asp.Net MVC3: http://biasecurities.com/blog/2011/using-pjax-with-asp-net-mvc3/
- FuelPHP: https://github.com/rcrowe/fuel-pjax
- Grails: http://www.bobbywarner.com/2012/04/23/add-some-pjax-to-grails/
- Express: https://github.com/abdelsaid/express-pjax-demo
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, render_template_string, request | |
| class CustomFlask(Flask): | |
| jinja_options = Flask.jinja_options.copy() | |
| jinja_options.update(dict( | |
| block_start_string='<%', | |
| block_end_string='%>', | |
| variable_start_string='%%', | |
| variable_end_string='%%', | |
| comment_start_string='<#', |
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
| """ | |
| exp ::= exp + term | exp - term | term | |
| term ::= term * factor | term / factor | factor | |
| factor ::= number | ( exp ) | |
| """ | |
| class Calculator(): | |
| def __init__(self, tokens): | |
| self._tokens = tokens | |
| self._current = tokens[0] |
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
| # luna_pinyin.custom.yaml | |
| # 修改字典名爲 luna_pinyin.kunki | |
| # 其對應的用戶詞典名取句點之前部分即 luna_pinyin | |
| patch: | |
| translator/dictionary: luna_pinyin.kunki |
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
| #weasel.custom.yaml | |
| patch: | |
| "preset_color_schemes/Solarized_Lite": | |
| author: "五磅兔 [email protected], based on Aben's 曬經石\solarized_Rock, original artwork by ethanschoonover‘s solarized" | |
| back_color: 0xe3f6fd #底色 | |
| border_color: 0xd5e8ee #边框色 | |
| candidate_text_color: 0x837b65 #候选项颜色 | |
| comment_text_color: 0xd28b26 #编码提示颜色 | |
| hilited_back_color: 0xd5e8ee #编码底色 | |
| hilited_candidate_back_color: 0x98a12a #首选项高亮背景色 |
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
| // NOTE: I previously suggested doing this through Grunt, but had plenty of problems with | |
| // my set up. Grunt did some weird things with scope, and I ended up using nodemon. This | |
| // setup is now using Gulp. It works exactly how I expect it to and is WAY more concise. | |
| var gulp = require('gulp'), | |
| spawn = require('child_process').spawn, | |
| node; | |
| /** | |
| * $ gulp server | |
| * description: launch the server. If there's a server already running, kill it. |
Python <-> c++ interface example for multidimensional arrays
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
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
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 graphlab as gl | |
| import math | |
| import random | |
| train = gl.SFrame.read_csv('data/train.csv') | |
| test = gl.SFrame.read_csv('data/test.csv') | |
| del train['id'] | |
| def make_submission(m, test, filename): | |
| preds = m.predict_topk(test, output_type='probability', k=9) |