Hacker Newsnew | past | comments | ask | show | jobs | submit | defunkt's commentslogin

If you use your own server make sure you set the Access-Control-Allow-Origin header:

https://github.com/defunkt/dotjs/blob/master/bin/djsd#L26

(Also, Ruby comes with OS X (just like Python) so it seemed a sane choice.)


But Python comes with OSX and Ubuntu


But Ruby is the language the developer uses when doing something basic like this?


Python usually, as far as I can tell. Either language is fine, I just think these things should be done in something that comes pre-installed on more systems.


I mean, I knew Chris years ago and his language of choice was Ruby, and I don't think it's changed.

Sure basic install-ability is great, but I bet you this tool was made to satiate an itch he had, and he used the tools he's used to. Little apps like these aren't engineered. Just hacks, for hacks sake.


Feel free to fork the project and make it Python-based. defunkt works at Github and does most of his work in Ruby from what I can see.


Installing ruby on Ubuntu is easy. Most users of this kind of extension would probably know how.


That's all true, but dotjs is only for Google Chrome on OS X.

Google Chrome on OS X has no such filesystem-based model for managing scripts.


You know that once a user script is installed in chrome you can edit the script.js file in the extension's directory on the fly. It's a little more work than simply putting a file in ~/.js but it doesn't require a HTTP server to function.


True, and this is why I love dotjs. Thanks for making it!

Maybe a good followup project would be to use some of the dotjs code to help make a filesystem-based GreaseMonkey system for Chrome, which would be just as easy to manage as dotjs scripts are.


So actually it's much worse than Greasemonkey.

Also, with GM you can just save the script with the same filename and it'll use that instead.

This project is 100% useless.


Unless you don't use Firefox and you tend to have a lot of dot files that you hack around with in your home directory. Then it starts to seem pretty awesome.


Chrome runs Greasemonkey-scripts, too. They are automatically converted to extensions in the background. Works very well. ( http://blog.chromium.org/2010/02/40000-more-extensions.html )

But I wouldn't call this useless. It's just another approach.


Chrome extensions can't access the local filesystem so we have to start a tiny webserver in the background.

If someone knows a way around this limitation, or a simpler webserver to require / embed, I would be thrilled. But so far this is the best I've found.


Did you investigate requesting the files directly from the filesystem, like "file:///home/monkey/.js/google.com.js".

You'd need to tell users to enable file access for the extension though chrome://extensions/, since that isn't enabled by default and users have to opt into it. I also don't know if there is a way to get the current user's homedir without hardcoding it.

Also: you're being super careful to not allow arbitrary reading of the filesystem, right? A good sanity check would be to ensure that realpath() of any file served is under ~/.js before handing it off.


ahahahahah what? Dude, do you work for Microsoft? "Well see, we just have to run MS-SQL server (DESKTOP OMG EXPRESS ENGINE) here, and then we run IIS on top of it to serve this file listing..."


He co-founded GitHub and is the CEO presently. That will be good enough for you?


It's a limitation of Chrome. This isn't the first time that someone tried to use a local webserver to do something that Chrome doesn't allow. IIRC, there was someone that used a webserver to implement a hacky version of It'sAllText! for Chrome.



GitHub now owns the octocat art.


githacking left me with the impression that it was an official github thing, because of the octocat.


Cool! Congrats on finally getting it. :-)


You guys should seriously think about allowing other projects to use the octocat when the projects are associated to github.

it would be a nice way of everybody having a common "icon", much like twitter has the bird.

I know people can link to github, but that's not always possible (mobile apps?) even though people use github..


Twitter previously used some stock bird art, but the logo was just the bubble letters. Now they have an original bird logo. But 3rd party Twitter stuff can use arbitrary bird art, or maybe the old stock one since it's unclear who owns it.

I think a good solution would be a new open license logo, like the Minefield logo as opposed to the restricted Firefox logo.


Sorry about that. It should show up in 'germany' and some others now, like 'rails' in the first search field and 'europe' in the second (location).


I want to do all of this stuff. Great post.


I've been wanting OAuth for stuff like http://calendaraboutnothing.com/. There's no way we should advocate entering GitHub passwords or API tokens into a 3rd party web apps.


Agreed! I want to build our entire community site around Github, but I don't want people to provide their usernames/passwords, and I'd prefer a way to specify whether or not they're providing access to SSH keys, which I don't need.


OAuth would be ideal. I made the feature request minimal to make it more acceptable =)


This is awesome to hear.


I feel like upvoting this doesn't properly convey the notion "I want to do all of this stuff too."


GitHub's similar functionality is open source:

https://github.com/pjhyett/github-services/blob/master/servi...



If each Unicorn worker listened on a different port, we'd have to use one of nginx's load balancing strategies (unless I'm misreading your comment).

We have not had success with them in the past which is why we employed HAProxy with mongrel.


You read me correctly, I don't see why load balancing should be taking place down at the app server level.

Aren't you going to have multiple machines each with their own blessing of unicorns? You're still going to have to use some kind of load balancer in front of independent sockets.


Unicorn is not for slow clients or static assets. That's what nginx is for. See http://unicorn.bogomips.org/PHILOSOPHY.html for info on Unicorn and slow clients.

nginx also has features like ESI, serving from memcached, and rate limiting which Unicorn does not (and doesn't need).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: