Quick guide on printing pretty dates in Rails
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
| export PATH=/usr/local/bin:$PATH | |
| Start manually: | |
| pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start | |
| Stop manually: | |
| pg_ctl -D /usr/local/var/postgres stop -s -m fast | |
| pg_ctl -D /usr/local/var/postgres status |
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
| # add something like this to config.ru | |
| # see https://github.com/kzk/unicorn-worker-killer | |
| if Integer(ENV['UNICORN_KILLER'] || 0) != 0 | |
| require 'unicorn/worker_killer' | |
| # Max memory size (RSS) per worker | |
| use Unicorn::WorkerKiller::Oom, (350*(1024**2)), (400*(1024**2)), 30, true | |
| end |
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
| class Person | |
| def initialize(attributes) | |
| attributes.each do |attribute_name, attribute_value| | |
| ##### Method one ##### | |
| # Works just great, but uses something scary like eval | |
| # self.class.class_eval {attr_accessor attribute_name} | |
| # self.instance_variable_set("@#{attribute_name}", attribute_value) | |
| ##### Method two ##### | |
| # Manually creates methods for both getter and setter and then |
HexaPDF is now able to use a TrueType font to generate content. There are still some limitations, like the missing support for subsets but most things work quite well already. Complete integration into the Canvas and font selection API is also not done yet.
The attached script generates a PDF showcasing all available glyphs defined in a font as well as a sample text containing characters from the Unicode BMP as well as from other Unicode planes.
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
| tap "caskroom/cask" | |
| cask "google-chrome" | |
| cask "firefox" | |
| brew "chromedriver" | |
| brew "geckodriver" |
- Website: https://stimulusjs.org/
- GitHub repo: https://github.com/stimulusjs/stimulus
- Handbook: https://stimulusjs.org/handbook/introduction
- Discourse: https://discourse.stimulusjs.org/
initialize: once, when the controller is first instantiatedconnect: anytime the controller is connected to the DOM
OlderNewer