start new:
tmux
start new with session name:
tmux new -s myname
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
-- Firstly, remove PRIMARY KEY attribute of former PRIMARY KEY
ALTER TABLE <table_name> DROP CONSTRAINT <table_name>_pkey;
-- Then change column name of your PRIMARY KEY and PRIMARY KEY candidates properly.
ALTER TABLE <table_name> RENAME COLUMN <primary_key_candidate> TO id;
module.exports = { | |
/** | |
* | |
* Using raw socket.io functionality from a Sails.js controller | |
* | |
*/ | |
index: function (req,res) { |
People
![]() :bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
// ==================================================================================== | |
// Example of iterating over the `where` clause from a stage 2 query from Waterline. | |
// (the example below attempts to demonstrate a few of the most useful guarantees) | |
// | |
// > Mostly pay attention to the structure. Other than that, you can safely assume | |
// > that, in short, everything is valid (+in a schema-aware way), guaranteed. | |
// ==================================================================================== | |
/* ~%° before iterating */ |
Reference: https://gitter.im/balderdashy/sails?at=58be4b1af1a33b62758d57ea
Is there anyway that I can add a method to all routes?
Given a Sails app with two models User
and Pet
, how do we create a single controller action foo
and have it automatically run on requests for both /user/foo
and /pet/foo
?
#!/bin/bash | |
cd /tmp || exit | |
read -r -p "[s]table or [b]eta? [sS/bB] " choice | |
choice=${choice,,} # tolower | |
if [[ ! "$choice" =~ ^(s|b)$ ]]; then | |
exit | |
fi | |
if [[ "$choice" = "s" ]]; then | |
url=https://dl.pstmn.io/download/latest/linux64 | |
name=Postman |
Some of the naming conventions we use at Sails for nouns like variables, parameters, property names, config settings, database attributes/columns/fields, and so on.
Naming is hard. And naming conventions usually end up being wrong, or incomplete at best.
This may be an unpopular opinion, but in my experience, coming up with new methodologies for variables and such doesn't usually create a lot of value for an individual developer. So why bother?