Verify Permissions
diskutil verifyPermissions /
Repair Permissions
diskutil repairPermissions /
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Kernel Flags</key> | |
<string>mbasd=1</string> | |
</dict> | |
</plist> |
# coding=UTF-8 | |
import nltk | |
from nltk.corpus import brown | |
# This is a fast and simple noun phrase extractor (based on NLTK) | |
# Feel free to use it, just keep a link back to this post | |
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/ | |
# Create by Shlomi Babluki | |
# May, 2013 |
<!--- | |
This is a advanced javascript checkout built with Commerce.js (http://commercejs.com). | |
Tutorial: Checkout Tutorial (Advanced) - http://commerce.js.com/docs/overview/checkout-tutorial-advanced/ | |
!--> | |
<html> | |
<head> | |
<title>Checkout Tutorial (Advanced)</title> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/2.7.2/jquery.serializejson.js"></script> | |
<script type="text/javascript" src="https://chec-cdn.s3.amazonaws.com/js/commerce.js"></script> |
// https://m.cafe.naver.com/eojji/302 | |
// unit: msec | |
function timeCheck(startTime, needTime) { | |
var nowDate = new Date(); | |
// remain = 6 min - ( now - start ) | |
var remain = 360000 - (nowDate.getTime() - startTime); | |
if (remain < needTime) { | |
return false; | |
} else { | |
return true; |
// https://m.cafe.naver.com/eojji/307 | |
function setPageTokenProperty(value) { | |
PropertiesService.getUserProperties().setProperty('PAGE_TOKEN', value); | |
} | |
function getPageTokenProperty() { | |
var pageTokenProperty = PropertiesService.getUserProperties().getProperty('PAGE_TOKEN'); | |
return pageTokenProperty; | |
} |
The good news: you can get it running on the free tier (with a tiny instance).
The bad news: it's stuck on Elasticsearch 1.5.2 and dynamic scripting (Groovy) is disabled.
http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-limits.html
Authentication: the safest option is to create a brand new IAM user (using the tool at https://console.aws.amazon.com/iam/home?region=us-east-1 ) with its own access key and secret key. Then when you create the Elasticsearch instance you can paste in the following IAM string:
import csv, sys | |
def fetch_data(): | |
# Returning some example data - hit a JSON API or something here | |
return [{ | |
"name": "Name 1", | |
"age": 32, | |
"description": "Look, we can use commas and\ttabs & stuff in here!", | |
}, { | |
"name": "Name 2", |
""" | |
Simple demonstration of how to implement Server-sent events (SSE) in Python | |
using Bottle micro web-framework. | |
SSE require asynchronous request handling, but it's tricky with WSGI. One way | |
to achieve that is to use gevent library as shown here. | |
Usage: just start the script and open http://localhost:8080/ in your browser. | |
Based on: |
class EmailSearch(FacetedSearch): | |
doc_types = [Email] | |
# fields that should be searched | |
fields = ['subject', 'body'] | |
facets = { | |
'inbox': TermsFacet(field='inbox'), | |
} | |
def filter(self, search): |