Skip to content

Instantly share code, notes, and snippets.

@eishay
eishay / bay-scala-jobs
Last active December 10, 2015 20:18 — forked from ymasory/bay-scala-jobs
Companies hiring Scala developers in the Bay Area.
Created in response to a thread on scala-base.
I started the list, so I get to be biased :)
- CloudPhysics (my employer)
- Wordnik (last employer, very cool people)
Unbiased list:
- 10Gen
- Bizo
app/
assets/
templates/
my_view.handlebars
widget/
another_view.hanblebars
@eishay
eishay / gist:2491018
Created April 25, 2012 16:18
Ember.View.extend
var myView = Ember.View.extend({ templateName: 'my_view' }),
myWidget = Ember.View.extend({ templateName: 'widget/another_view' });
GET /template/:name my.package.Templates.load(name: String, callback: String)
//current is a reference to the Application object
import play.api.Play.current
object Templates extends Controller {
//name is the template name
//callback is the jQuery jsonp function name as in jQuery17104730278281494975_1332396095851
def load(name: String, callback: String) = Action { request =>
val path = current.getFile("/templates/%s.handlebars.html".format(name));
val content = Files.readFile(path)
//making the file content javascript ready
Ember.View.create({
templateName: templateId
});
getResources: function (path, callback) {
$.ajax({
'dataType': 'jsonp text',
'crossDomain': true,
'url': path,
'success': function (data) {
utils.async(function () {
callback(data)
});
},
@eishay
eishay / gist:1843026
Created February 16, 2012 07:42
JsTestDriver conf
load:
- public/javascripts/external/jquery-1.7.1.min.js
- http://localhost:9000/assets/javascripts/my_file1.js
- http://localhost:9000/assets/javascripts/my_file2.js
- test/javascripts/*.js
try {
doSomethingThatThrows.exception();
} catch (Exception e) {
throw uncheked(e);
}
// Code licensed under the Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0
public class AnyThrow {
public static RuntimeException uncheked(Throwable e) {
AnyThrow.<RuntimeException>throwAny(e);
return null;
}
@SuppressWarnings("unchecked")