Send multiple emails to different recipients.
# app/mailers/notify_mailer.rb
class NotifyMailer < ApplicationMailer| #!/bin/bash | |
| # exports separate sql files for each table in the db. excludes "pg_" and "sql_" prefixed tables | |
| for table in $(psql database_name -t -c "Select table_name From information_schema.tables Where table_type='BASE TABLE' and table_name not like 'pg_%' and table_name not like 'sql_%'"); | |
| do pg_dump -t $table database_name > /path/to/export/your/tables/$table.sql; | |
| done; |
| packages: | |
| yum: | |
| git: [] | |
| htop: [] |
| /*********** | |
| iPhone 2G-4S | |
| ************/ | |
| /* iPhone 2G-4S In Portrait & Landscape */ | |
| @media only screen | |
| and (min-device-width : 320px) | |
| and (max-device-width : 480px) { | |
| } |
| const flattenTco = ([first, ...rest], accumulator) => | |
| (first === undefined) | |
| ? accumulator | |
| : (Array.isArray(first)) | |
| ? flattenTco([...first, ...rest]) | |
| : flattenTco(rest, accumulator.concat(first)) | |
| const flatten = (n) => flattenTco(n, []); | |
| console.log(flatten([[1,[2,[[3]]]],4,[5,[[[6]]]]])) |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
| AllCops: | |
| RunRailsCops: true | |
| # Commonly used screens these days easily fit more than 80 characters. | |
| Metrics/LineLength: | |
| Max: 120 | |
| # Too short methods lead to extraction of single-use methods, which can make | |
| # the code easier to read (by naming things), but can also clutter the class | |
| Metrics/MethodLength: |
This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.
Most the credit for these changes go to Dave Holland.
| #!/bin/sh | |
| # | |
| # The MIT License | |
| # | |
| # Copyright 2014-2017 Jakub Jirutka <jakub@jirutka.cz>. | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| # SYNTAX: | |
| var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches) | |
| var pattern = /pattern/attributes; # same as above | |
| # BRACKETS: | |
| [...]: Any one character between the brackets. | |
| [^...]: Any one character not between the brackets. |