Skip to content

Instantly share code, notes, and snippets.

View DominusKelvin's full-sized avatar
👨‍💻
Working remotely.

Kelvin Oghenerhoro Omereshone DominusKelvin

👨‍💻
Working remotely.
View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 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
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 7, 2024 07:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mikermcneil
mikermcneil / plugins_proposal.md
Last active October 19, 2020 08:42
Sails.js v0.9 plugins proposal

A Modest Proposal: Hooks

Sails.js v0.9: Release Cantidate for 1.0

Philosophy

  • The question of what "belongs" in a framework is complex, and depends on your use case. A better question is "what are the defaults?" By pulling all of the current features of Sails into plugins, and then including them by default, we provide full customizability (the possibility of disabling just about everything) without sacrificing all the conveniences Sails developers are used to.
  • Plugins make it easier to contribute, and make modifying the core a much less scary proposition.
  • Node.js is quite minimalist, and super awesome. Let's take a leaf out of Ryan/Isaac's book!
  • Community plugins are fantastic, but to ensure quality, plugins will only be listed on the Sails website/repo when they've met some basic quality assurance testing.
@scaryguy
scaryguy / change_primary_key.md
Last active July 6, 2024 02:45
How to change PRIMARY KEY of an existing PostgreSQL table?
-- 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;
@mikermcneil
mikermcneil / using-raw-socket-io-in-sails.js
Created September 17, 2013 18:32
Using raw socket.io functionality in a Sails.js controller
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
@rxaviers
rxaviers / gist:7360908
Last active July 7, 2024 09:52
Complete list of github markdown emoji markup

People

:bowtie: :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:
@mikermcneil
mikermcneil / example-of-iterator-for-where-clause-of-stage-2-query-in-waterline-0.13-and-sails-v1.js
Last active August 17, 2022 12:48
example of iterator for the `where` clause from the `criteria` query key of a stage 2 query in waterline 0.13 / sails v1 (also works for stage 3 queries)
// ====================================================================================
// 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 */
@sgress454
sgress454 / custom-blueprint.md
Last active March 5, 2022 06:05
Adding a custom blueprint action to all models

Reference: https://gitter.im/balderdashy/sails?at=58be4b1af1a33b62758d57ea

Is there anyway that I can add a method to all routes?

The issue

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?

The solution

@lira
lira / postman-update.sh
Last active October 26, 2023 11:16 — forked from jcharlier/postman-update.sh
Install/Update postman or postman canary (beta) for linux. Tested in ubuntu 17.10 gnome3
#!/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
@mikermcneil
mikermcneil / How to name a noun.md
Last active October 7, 2023 16:51
Naming conventions for things like variables, parameters, and attributes. (Naming nouns)

How to name a noun

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.

Why bother?

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?