This file contains hidden or 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
angular.module("FundooDirectiveTutorial", []).controller("FundooCtrl", ($scope, $window) -> | |
$scope.rating = 5 | |
$scope.saveRatingToServer = (rating) -> $window.alert "Rating selected - " + rating | |
).directive "fundooRating", -> | |
restrict: "A" | |
template: "<ul class=\"rating\">" + "<li ng-repeat=\"star in stars\" ng-class=\"star\" ng-click=\"toggle($index)\">" + "★" + "</li>" + "</ul>" | |
scope: | |
ratingValue: "=" | |
max: "=" | |
readonly: "@" |
This file contains hidden or 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
scala> Json.toJson((1, 2)) | |
<console>:20: error: No Json deserializer found for type (Int, Int). Try to implement an implicit Writes or Format for this type. | |
Json.toJson((1, 2)) | |
^ | |
scala> implicit val x = new Writes[(Int, Int)] { | |
| def writes(t: (Int, Int)): JsValue = { | |
| JsArray(Seq(JsNumber(t._1), JsNumber(t._2))) | |
| } | |
| } |
This file contains hidden or 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
Hi Jack, | |
Ever watch someone’s head explode because they get so excited about what they are doing? Every manager and candidate I talk to | |
says they want PASSION in the people they hire, the people they work with, and the position they hold. But when I actually speak | |
with an individual who can CONVEY that passion and not just mouth the words, it’s a real treat. So I’m talking to this manager, | |
and when we challenge her on the passion part, man did she go off. I mean wow. So it’s a software developer position. The | |
descriptions are basically the same. RubyRubyRubyRuby. Ruby Tuesday, Ruby will you be mine, Jack Ruby, Ruby on rails, Ruby don’t | |
bring your love to town, Ruby Red, Ruby Web, Ruby Mobile. But what you will be doing, what you will be working on, what you will | |
discover, what you will learn…Its impossible to convey the excitement this person displayed, the descriptions she gave, the | |
PASSION she felt for her company and product. This a social media acorn waiting to grow into an oak tree of aggregated real ti |
This file contains hidden or 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
__________ - noun | |
a situation where one relatively small change can influence the | |
potential energy of an outcome by orders of magnitude. | |
example: if you have a fair coin and flip it, you have a 50/50 shot of | |
heads or tails. An intelligent person would not place wagers on this game if played to infinity. | |
If you change the weighting and make it 49/51 then that intelligent person |
This file contains hidden or 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
1 var fallacy_buttons = "<a href='#' onclick='$(\".usertext-edit textarea\").val(\"https://yourlogicalfallacyis.com/strawman\");'>strawman</a> | " + | |
2 "<a href='#' onclick='$(\".usertext-edit textarea\").val(\"https://yourlogicalfallacyis.com/false-cause\");'>false-cause</a>" | |
3 var buttons = "<div id='logical_fallacy' style='background-color: lightgrey'>" + fallacy_buttons + "</div>"; | |
4 | |
5 $("#header-bottom-left").after(buttons); |
This file contains hidden or 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
foo = -> | |
alert 'it has it' |
This file contains hidden or 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
109 class ActiveAdmin::BaseController | |
110 def current_ability | |
111 @current_admin_ability ||= AdminAbility.new(current_admin_user) | |
112 end | |
113 | |
114 def user_for_paper_trail | |
115 current_admin_user | |
116 end | |
117 | |
118 def info_for_paper_trail |
This file contains hidden or 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
I'm wondering what speed benefits using rails-api gives you over the normal rails stack. Conceptually it makes sense that removing unneeded pieces will help, but most of the default rails middleware is still in place, so I'm wondering if the boost is actually noticeable. | |
Removing those pieces does restrict your ability to use things like active_admin to manage your data, so I'd only go with the slimmer rails-api style project if the improvements are noticeable. |
This file contains hidden or 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
git rm `git status | grep deleted | cut -f2 -d: | xargs` |
This file contains hidden or 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
= form_for @list do |f| | |
no routes matches /lists | |
= form_for @list, url: (@list.new_record? ? lists.lists_path : lists.list_path(@list) do |f| |