start new:
tmux
start new with session name:
tmux new -s myname
| #define ANALOG_IN 0 | |
| void setup() { | |
| Serial.begin(9600); | |
| //Serial.begin(115200); | |
| } | |
| void loop() { | |
| int val = analogRead(ANALOG_IN); | |
| Serial.write( 0xff ); |
| # Call scopes directly from your URL params: | |
| # | |
| # @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
| module Filterable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| # Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
| # with their associated values. For example, "{ status: 'delayed' }" would call |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| stats = Sidekiq::Stats.new | |
| stats.queues | |
| stats.enqueued | |
| stats.processed | |
| stats.failed |
| #!/bin/bash | |
| # update apt-get | |
| export DEBIAN_FRONTEND="noninteractive" | |
| sudo apt-get update | |
| # remove previously installed Docker | |
| sudo apt-get remove docker docker-engine docker.io* lxc-docker* | |
| # install dependencies 4 cert |
root user (sudo su).nginx in /opt/redash.certs and certs-data./opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
upstream redash {
server redash:5000;
}
| - Add `gem 'tzinfo-data'` to the Gemfile. | |
| - Add `tzdata` to the Dockerfile | |
| ``` | |
| RUN apk update \ | |
| && apk add build-base \ | |
| tzdata | |
| ``` | |
| - Build `docker-compose build` or `docker-compose up --build` | |
| - Enjoy the life |
| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |