Skip to content

Instantly share code, notes, and snippets.

View ngsmrk's full-sized avatar

Angus Mark ngsmrk

  • London
  • 21:01 (UTC +01:00)
View GitHub Profile
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);
}
@ngsmrk
ngsmrk / sidekiq_monitoring
Created August 11, 2014 11:51
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
@ngsmrk
ngsmrk / gist:e0bf7a0cec044eb615a1
Last active August 29, 2015 14:15
Clojure -> Example of record defintion
(defrecord Team [name])
(defrecord Player [name team])
(def player-1 (Player. 'Joe (Team. 'Arsenal)))
(print (:name player-1))
(print (:name (:team player-1)))
@ngsmrk
ngsmrk / gist:00c9486931834d8e8e1b
Created February 19, 2015 21:57
Clojure -> import, instantiate and call java.util.Random
(import '(java.util Random)
(def rnd (new Random))
(. rnd nextInt)