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
| def palindrome?(x) | |
| x = x.to_s | |
| if x.length == 1 | |
| return true | |
| elsif (x.length % 2) == 0 | |
| a = x[0..(x.length / 2 - 1)] | |
| b = x[(x.length / 2)..(x.length)].reverse | |
| else | |
| x = x.split('') |
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
| - klass = @feed.fav_post ? 'favorited' : '' | |
| .UI_feed_item.deletable.clearfix{ class: klass, feed_id: "#{@feed.id}", id: "feed_item_#{@feed.id}" } |
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
| var inputs = [].slice.call(document.querySelectorAll('.quantity')); | |
| inputs = inputs.filter(function (x) { return x.children[0] && x.children[0].classList.contains('js-change-total') }); | |
| inputs.reduce(function (x,y) { return x + parseFloat(y.children[0].value) }, 0); |
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
| establishment name | network name | network password | |
| One Girl Cookies | One Girl Cookies | cupcakes | |
| Tugboat Tea Company | Tugboat Tea Co. | plugin@tug |
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
| ;; CL (ext:shell (...)) | |
| ;; SBCL (sb-ext:run-program (...)) |
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
| function firstNonRepeatingLetter (str) { | |
| var str_arr = str.split(''); | |
| return str_arr.filter(function (x) { | |
| return str_arr.indexOf(x) === str_arr.lastIndexOf(x); | |
| })[0]; | |
| } | |
| firstNonRepeatingLetter('aardvark') === 'd' // true |
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
| # ~/.tmuxinator/slime.yml | |
| name: slime | |
| root: ~/ | |
| windows: | |
| - editor: | |
| layout: main-vertical | |
| panes: | |
| - vim |
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
| = link_to(some_path, {class: 'btn btn-large'}) do | |
| %i.icon-plus-sign | |
| Do Some Thing |
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
| (defn foo | |
| ([] (foo "bar")) | |
| ([bar] (prn bar))) | |
| (foo) ;; "bar" | |
| (foo "baz") ;; "baz" |
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
| "A monad is a collection of functions that can be used to modify stepwise calculations." - Marick |