이 글은 2015년의 루비 코리아 대림달력을 위해 작성되었습니다.
루비 코리아의 대림 달력도 벌써 4일째입니다. 오늘은 루비 이야기는 아니긴 합니다만, 레일스와 관련있는 이야기를 해볼까 합니다.
| // Inspired by a tweet from @trautonen 1/13/2016 | |
| // Use Source.unfoldAsync to turn paginated database results into an akka-streams Source | |
| // unfold is the inverse of fold | |
| case class Page[T](pageNumber:Long, totalPages:Long, contents:List[T]) | |
| case class Thing(id: Long, name: String = "foo") | |
| val totalPages = 5 // | |
| val pageSize = 3 |
이 글은 2015년의 루비 코리아 대림달력을 위해 작성되었습니다.
루비 코리아의 대림 달력도 벌써 4일째입니다. 오늘은 루비 이야기는 아니긴 합니다만, 레일스와 관련있는 이야기를 해볼까 합니다.
| #include <SPI.h> | |
| #include <nRF24L01.h> | |
| #include <RF24.h> | |
| #define DEVICE_ID 2 | |
| #define CHANNEL 1 //MAX 127 | |
| RF24 radio(15, 15); // Set up nRF24L01 radio on SPI bus plus pins 7 & 8 | |
| // Topology | |
| const uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL }; |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| import redis | |
| import threading | |
| class Listener(threading.Thread): | |
| def __init__(self, r, channels): | |
| threading.Thread.__init__(self) | |
| self.redis = r | |
| self.pubsub = self.redis.pubsub() | |
| self.pubsub.subscribe(channels) | |
Movies Recommendation:
Music Recommendation: