$ rails g model User
belongs_to
has_one
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
// ************** Instructions for connecting to the LiveCoding chatrooms from a 3rd party application. **************** | |
Step 1a (Ubuntu/ any OS with aptitude (aka apt-get)) : | |
sudo apt-add-repository ppa:rsrchboy/profanity && sudo apt-get update | |
apt-get install profanity | |
-- | |
Step 1b (OSX w/ homebrew): | |
$ brew install profanity | |
-------- |
# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
window.navigator.standalone |
CREATE EXTENSION IF NOT EXISTS "pgcrypto"; | |
-- Create a trigger function that takes no arguments. | |
-- Trigger functions automatically have OLD, NEW records | |
-- and TG_TABLE_NAME as well as others. | |
CREATE OR REPLACE FUNCTION unique_short_id() | |
RETURNS TRIGGER AS $$ | |
-- Declare the variables we'll be using. | |
DECLARE |
model = Repo.get!(Model, id) | |
Ecto.Changeset.change(model) | |
|> Ecto.Model.Timestamps.put_timestamp(:deleted_at, Ecto.DateTime, true) | |
|> Repo.update |