bold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit | |
CREATE TABLE func_table ( | |
id serial NOT NULL PRIMARY KEY, | |
value integer NOT NULL | |
); | |
-- | |
-- Make column unique. | |
-- | |
ALTER TABLE func_table ADD CONSTRAINT unique_value UNIQUE (value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit | |
-- ============================================================================ | |
-- Returns the comments for all functions we'll create. | |
-- | |
-- Precondition: | |
-- | |
-- Assumes you are currently using a database. | |
-- | |
-- Usage: | |
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit | |
-- ============================================================================ | |
-- Create a view to easily read table comments. | |
-- | |
-- Returns: | |
-- | |
-- A list of table names and comments associated with them. | |
-- | |
-- Usage: | |
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit | |
-- ============================================================================ | |
-- Returns the comments for all columns in a table. | |
-- | |
-- Precondition: | |
-- | |
-- Assumes you are currently using a database. | |
-- | |
-- Usage: | |
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit | |
sudo su - postgres | |
Run 'psql' to connect, or 'psql -E' to connect and show psql queries. | |
Commands: | |
\l | List databases | |
\connect db_name | Use db_name database | |
\dt | List tables | |
\dv | List views |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Lambda { // requires >= java 1.8 | |
interface IntegerMath { | |
int operation(int a, int b); | |
default IntegerMath swap() { | |
return (a, b) -> operation(b, a); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/22475849/node-js-error-enospc#32600959 | |
``` | |
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
$ sudo sysctl --system # Not sure if this is necessary | |
``` | |
Source: https://github.com/facebook/create-react-app/issues/2549 |
Copy and paste into terminal:
echo "This is example.txt" > example.txt
cat example.txt
ln -s example.txt symlink.txt
cat example.txt
cat symlink.txt
echo "UPDATED" >> example.txt
cat example.txt
cat symlink.txt
$ gem uninstall bundler
$ gem install bundler --version '1.3.6'
OlderNewer