This file contains 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
(import '(java.util Random) | |
(def rnd (new Random)) | |
(. rnd nextInt) |
This file contains 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
(defrecord Team [name]) | |
(defrecord Player [name team]) | |
(def player-1 (Player. 'Joe (Team. 'Arsenal))) | |
(print (:name player-1)) | |
(print (:name (:team player-1))) |
This file contains 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
stats = Sidekiq::Stats.new | |
stats.queues | |
stats.enqueued | |
stats.processed | |
stats.failed |
This file contains 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
static void in_received_handler(DictionaryIterator *iter, void *context) { | |
APP_LOG(APP_LOG_LEVEL_DEBUG, "App Message Received"); | |
Tuple *word_tuple = dict_find(iter, QUOTE_KEY_INIT); | |
strncpy(word, word_tuple->value->cstring, 100); | |
text_layer_set_text(text_layer, word); | |
} |
This file contains 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 fetch_random_word() { | |
var req = new XMLHttpRequest(); | |
req.open('GET', 'http://thesaurus-rex.herokuapp.com/random_word/', true); | |
req.onload = function (e) { | |
var status = req.status; | |
var readyState = req.readyState; | |
console.log("Status: " + status + ", state: " + readyState); | |
if (req.readyState == 4 && req.status == 200) { |
This file contains 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
Pebble.addEventListener("appmessage", | |
function (e) { | |
console.log("message"); | |
fetch_random_word(); | |
} | |
); |
This file contains 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
static void init(void) { | |
window = window_create(); | |
window_set_click_config_provider(window, click_config_provider); | |
} | |
static void click_config_provider(void *context) { | |
window_single_click_subscribe(BUTTON_ID_SELECT, select_click_handler); | |
} | |
static void select_click_handler(ClickRecognizerRef recognizer, void *context) { |
This file contains 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
[ec2-user@<ip_address> ~]$ curl 0.0.0.0:49154 | |
<!DOCTYPE html><html><head><title>Express</title> | |
<link rel="stylesheet" href="/stylesheets/style.css"> | |
</head><body><h1>Express</h1> | |
<p>Welcome to Express</p></body></html> |
This file contains 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
[ec2-user@<ip_address> ~]$ sudo docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
bc1b8759a328 ngsmrk/express_image_01:latest /bin/bash 15 seconds ago Up 13 seconds 0.0.0.0:49154->3000/tcp loving_pare |
This file contains 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
cd /home/docker/dev/test_app | |
DEBUG=my-application ./bin/www |
NewerOlder