This file contains 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
/* | |
Most stuff up here seemed to need no change the orginal unmodified may be found here: | |
https://github.com/share/ShareJS/blob/0.6/webclient/ace.js | |
ideally you should be able to use it thus: | |
sjs = new window.sharejs.Connection(sock); | |
var doc = sjs.get('users', 'blah ' + Math.random()); | |
doc.attach_ace(editor); // editor here here is some ace editor object i.e: var editor = ace.edit("editor"); | |
############### |
This file contains 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
## this is my simple tornado asynchttpclient that fetches files: | |
## trouble is its giving damaged pdf's on downdload, im using it | |
## with python 3.3.2, (with 2.7x i did not need to specify encoding | |
## but with python 3.3.2 i have to specify it, but still get corrupted | |
## file. | |
from tornado import ioloop, httpclient | |
def get_file(url): |
This file contains 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 sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
''' | |
Base Daemon class that takes care of the start, stop, and forking of the processes. | |
Used to daemonize any Python script. | |
''' |
This file contains 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
worker_processes 2; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} |
This file contains 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
Oct 17, 2012 - See https://github.com/medined/accumulo_stackscript for an even better script. Really ignore the stuff below. Go. Scoot. | |
Aug 28, 2012 - See http://affy.blogspot.com/2012/08/stackscript-for-accumulo-on-linode.html for a more concise method is configuring accumulo. I'll leave this gist unchanged for fans of history. | |
My goal was to get Accumulo running on a VirtualBox Ubuntu instance. I was successful using the following steps. If a line starts with $ then it is a command-line to execute. Note that you'll need to have sudo privilege. My username was 'ubuntu'. If you are using a different username, you'll need to change the process a little bit. I'll try to point out where. | |
https://issues.apache.org/jira/browse/ACCUMULO | |
########## | |
# Start a new VirtualBox instance using the Ubuntu 11.10 |
This file contains 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
################entering some data the first time to my form doesnt work, it gives this error: | |
IntegrityError at /job/add/article/ | |
(1048, "Column 'author_id' cannot be null") | |
Request Method: POST | |
Request URL: http://localhost:8000/job/add/article/ | |
Django Version: 1.4.3 |
This file contains 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
####### My form isnt getting saved because of this error: iv marked line 19 in the view is line 26 in this gist | |
TypeError at /job/add/article/ | |
save() takes at least 2 arguments (1 given) | |
Request Method: POST | |
Request URL: http://localhost:8000/job/add/article/ | |
Django Version: 1.4.3 | |
Exception Type: TypeError |
This file contains 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
#################im getting this type error from on of my views: | |
TypeError at /job/add/article/ | |
must be type, not JobForm | |
Request Method: GET | |
Request URL: http://localhost:8000/job/add/article/ | |
Django Version: 1.4.3 | |
Exception Type: TypeError |
This file contains 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
## how would i make this url more robust? | |
url(r'^$', | |
'job.list_detail.object_list', | |
{ | |
'queryset': Job.objects.all(), ## how do i make this robust? right now if the database is empty i get an error | |
}, | |
name='job_slug_index'), | |
##here is the error: |
This file contains 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
class TimeLogForm(forms.ModelForm): | |
class Meta: | |
exclude = ['begin_sec'] | |
model = TimeLog | |
def __init__(self, *args, **kw): | |
super(TimeLogForm).__init__(self, *args, **kw) | |
def save(self, *args, **kw): | |
instance = super(TimeLogForm, self).save(commit=False) |