Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph Hirn jhirn

View GitHub Profile
@jhirn
jhirn / cloudSettings
Created Apr 30, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-04-30T14:30:30.961Z","extensionVersion":"v3.2.9"}
View gist:6220e9e6eb44f5133a797040266320e3
function NumberDescriber(props) {
let description;
if (props.number % 2 == 0) {
description = <strong>even</strong>;
} else {
description = <h2>odd</h2>;
}
return <div>{props.number} is an {description} number</div>;
}
View dep_out.sh
#Pom without clj-http explicitly
jh@jhdmba:~/src/devmynd/opinionlab/dev/dev2/projects/alestorm (master) $ mvn dependency:tree -Dverbose=true | grep http
[INFO] | +- clj-http:clj-http:jar:0.7.7:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.3:compile
[INFO] | | +- (org.apache.httpcomponents:httpclient:jar:4.3:compile - omitted for conflict with 4.1.1)
[INFO] | | +- org.apache.httpcomponents:httpmime:jar:4.3:compile
[INFO] | | | \- (org.apache.httpcomponents:httpclient:jar:4.3:compile - omitted for conflict with 4.1.1)
[INFO] | | \- (org.apache.httpcomponents:httpclient:jar:4.0.1:test - omitted for conflict with 4.1.1)
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.1.1:test
View dep_out.sh
jh@jhdmba:~/src/devmynd/opinionlab/dev/dev2/projects/alestorm (master) $ mvn dependency:tree -Dverbose=true | grep http
[INFO] | +- clj-http:clj-http:jar:0.7.7:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.3:compile
[INFO] | | +- (org.apache.httpcomponents:httpclient:jar:4.3:compile - omitted for conflict with 4.1.1)
[INFO] | | +- org.apache.httpcomponents:httpmime:jar:4.3:compile
[INFO] | | | \- (org.apache.httpcomponents:httpclient:jar:4.3:compile - omitted for conflict with 4.1.1)
[INFO] | | \- (org.apache.httpcomponents:httpclient:jar:4.0.1:test - omitted for conflict with 4.1.1)
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.1.1:test
[INFO] | | +- (org.apache.httpcomponents:httpcore:jar:4.1:test - omitted for conflict with 4.3)
View composite.js
App.Views.List = Backbone.View.extend({
initialize: function() {
_.bindAll(this);
this.render();
},
render: function() {
var t = this;
this.$el.empty();
this.collection.each(function(item){
View nrepl opinionlab.lib.edn
; nREPL 20130829.156
user>
#<Namespace opinionlab.lib.generate-test-edn>
opinionlab.lib.generate-test-edn> (init-geoip)
true
opinionlab.lib.generate-test-edn> (clojure.pprint/pp(take 1 (apply (partial data-set-stream "resources/comments.xml") generators)))
ArityException Wrong number of args (1) passed to: pprint$pp clojure.lang.Compiler.macroexpand1 (Compiler.java:6473)
opinionlab.lib.generate-test-edn> (clojure.pprint/pp (take 1 (apply (partial data-set-stream "resources/comments.xml") generators)))
ArityException Wrong number of args (1) passed to: pprint$pp clojure.lang.Compiler.macroexpand1 (Compiler.java:6473)
opinionlab.lib.generate-test-edn> (clojure.pprint/pp (first (take 1 (apply (partial data-set-stream "resources/comments.xml") generators))))
View method_missing_nonsense.rb
def raise_error
raise RuntimeError
end
class Foo
def method_missing(name, *args)
raise_error
end
end
View MyView.js
App.Views.MyView = Backbone.View.extend({
initialize: function() {
_.bindAll(this); //Ignore this for now =)
this.template = JST['path/to/template'];
this.render();
},
render: function() {
this.$el.html(this.template({
collection: this.collection
View base_model.js
App.Models.BaseModel = Backbone.Model.extend({
preParse: function(data){},
constructor: function(attributes, options){
options = options || {};
options.parse = true;
Backbone.Model.call(this, attributes, options);
},
View js_extensions.js
(function() {
// Underscore methods that we want to implement on Array.
var methods = [
'all',
'any',
'compact',
'contains',
'countBy',
'detect',
'difference',