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
| // specify it under conversation style | |
| .conversation { | |
| header { | |
| padding-top: 12px; | |
| padding-bottom: 12px; | |
| } | |
| } | |
| // specify it explicitly | |
| header.single-line { |
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
| %header{class: topic.cover_image? ? 'coverimage' : ''} | |
| -if topic.cover_image? | |
| %figure.img-canvas-small | |
| =image_tag(comment.topic.cover_image) | |
| -# I want this execute seperately, but nested in header | |
| %article | |
| %h2 | |
| -if comment.conversation.subject? | |
| %a.title{ href: conversation_path(comment.conversation, anchor: comment.id.to_s), 'data-pjax' => '#container' } |
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
| __extends = function(child, parent) { | |
| __hasProp = {}.hasOwnProperty | |
| for (var key in parent) { | |
| if (__hasProp.call(parent, key)) | |
| child[key] = parent[key]; | |
| } | |
| function ctor() { | |
| this.constructor = child; |
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
| ### The current context | |
| The value of `this` in a javascript function call depends on the *execution context* of the function. If we take the above execution of `Simple()` but exclude the new keyword, | |
| `this` would refer to the global object and the `name` property would be added to that object. In a browser the global object is `window`, so in this example, name would be a property of | |
| the `window` object: | |
| ``` javascript | |
| Simple(); | |
| console.log(window.name); | |
| => "Adam" |
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(ring). | |
| -export([start/2, forward_to/1]). | |
| start(Number, Iterations) -> | |
| Pid = create_processes(Number-1), | |
| Pid ! msg, | |
| forward_to(Pid, Iterations, 0). | |
| create_processes(Number) -> | |
| io:format("spawning ~p processes...~n", [Number]), |
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(process_exc). | |
| -export([start/1, proc/1]). | |
| start(M) -> | |
| N1 = spawn(process_exc, proc, [M]), | |
| N2 = spawn(process_exc, proc, [M]), | |
| N1 ! {N2, ping}. | |
| proc(M) -> | |
| proc(M, 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
| #include <stdio.h> | |
| #include <assert.h> | |
| #include <stdlib.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #define MAX_DATA 512 | |
| #define MAX_ROWS 100 | |
| struct Address { |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| void die(const char *message) | |
| { | |
| if(errno) { | |
| perror(message); | |
| } else { |
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
| #ifndef __dbg_h__ | |
| #define __dbg_h__ | |
| #include <stdio.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #ifdef NDEBUG | |
| #define debug(M, ...) | |
| #else |
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
| #ifndef __dbg_h__ | |
| #define __dbg_h__ | |
| #include <stdio.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #ifdef NDEBUG | |
| #define debug(M, ...) | |
| #else |
OlderNewer