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
| % -*- coding: utf8 -*- | |
| % From LearnYouSomeErlang Functionally Solving Problems | |
| -module(main). | |
| -export([main/0]). | |
| main() -> | |
| 5 = rpn("2 3 +"), | |
| 87 = rpn("90 3 -"), | |
| -4 = rpn("10 4 3 + 2 * -"), | |
| -2.0 = rpn("10 4 3 + 2 * - 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
| %% So Dna will be a string like "ABCDEFG" | |
| %% and Erlang treats it like a list, but when you get the Head of the list | |
| %% it's not like a regular String like I'm used to, so to pattern match it I used the $ thing. | |
| %% Not sure what $ is called but it works to match when we get the character "G" from Dna. | |
| %% Fall through needs to convert the binary form back to a list | |
| %% So it looks like a String. | |
| %% that's my explanation... | |
| %%Dna = "ABCDEFG" | |
| rna(Dna) -> |
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
| // Modified from http://addyosmani.com/blog/essential-js-namespacing/ | |
| // top-level namespace being assigned an object literal | |
| var myApp = myApp || {}; | |
| // a convenience function for parsing string namespaces and | |
| // automatically generating nested namespaces | |
| function extend( namespace, namespace_string ) { | |
| var parts = namespace_string.split('.'); | |
| var parent = namespace; | |
| var partsLength; | |
| var index; |
This file has been truncated, but you can view the full file.
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
| { | |
| "Response": { | |
| "data": { | |
| "membershipId": "4611686018431291900", | |
| "membershipType": 2, | |
| "characters": [ | |
| { | |
| "characterBase": { | |
| "membershipId": "4611686018431291900", | |
| "membershipType": 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
| -module(functions). | |
| -compile(export_all). %%replace with -export() later! | |
| head([H|_]) -> H. | |
| second([_,X|_]) -> X. | |
| same(X,X) -> | |
| true; | |
| same(_,_) -> | |
| false. |
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
| -module(useless). | |
| -export([add/2, hello/0, greet_and_add_two/1]). | |
| add(A,B) -> | |
| A + B. | |
| %% Show greetings. | |
| %% io:format/1 is the standard function use to output text. | |
| hello() -> | |
| io:format("Hello, world!~n"). |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| /* | |
| * See http://davidwalsh.name/flexbox-dice | |
| * for this flexbox tutorial. I just wrote some code | |
| * to see for myself what was happening. |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| /* | |
| * See http://davidwalsh.name/flexbox-dice | |
| * for this flexbox tutorial. I just wrote some code | |
| * to see for myself what was happening. |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| /* | |
| * See http://davidwalsh.name/flexbox-dice | |
| * for this flexbox tutorial. I just wrote some code | |
| * to see for myself what was happening. |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| /* | |
| * See http://davidwalsh.name/flexbox-dice | |
| * for this flexbox tutorial. I just wrote some code | |
| * to see for myself what was happening. |