March 2017

Publishing with React VR

  • Posted on: 17 March 2017
  • By: davis

Here are some steps you might have overlooked when publishing your React VR project for the first time.

Here's my first finished project: http://daviseford.com/tcpi-react-vr/

1.) You have to upload the static_assets folder yourself - it's not included in the build folder.

2.) You need to modify your vr/build/index.html file to resemble this

<!-- When you're ready to deploy your app, update this line to point to your compiled client.bundle.js -->
    <script src="./build/client.bundle.js"></script>
    <script>
      // Initialize the React VR application
      ReactVR.init(
        // When you're ready to deploy your app, update this line to point to
        // your compiled index.bundle.js
        './build/index.bundle.js',
        // Attach it to the body tag
        document.body
      );
    </script>

3.) Seriously, pay careful attention to the index.html file

Generating Bash art with an ASCII Generator

  • Posted on: 14 March 2017
  • By: davis

http://patorjk.com/software/taag/

Example output below:

#     _____                           _         _______           _   
#    / ____|                         | |       |__   __|         | |  
#   | (___    __ _  _ __ ___   _ __  | |  ___     | |  ___ __  __| |_ 
#    \___ \  / _` || '_ ` _ \ | '_ \ | | / _ \    | | / _ \\ \/ /| __|
#    ____) || (_| || | | | | || |_) || ||  __/    | ||  __/ >  < | |_ 
#   |_____/  \__,_||_| |_| |_|| .__/ |_| \___|    |_| \___|/_/\_\ \__|
#                             | |                                     
#                             |_|                                     

Amazing software. Make sure to click "More opts" and select "Echo Commands" under the "Format the output" option.

There are hundreds of formatting options, you can choose your output format for easy inclusion in shell scripts, and you can preview all of the styles at once.

 

Dropping All Connections From a Postgres DB

  • Posted on: 8 March 2017
  • By: davis

For Postgres 9.2 and above, here's how you can drop all active connections to your database. This is useful when you're trying to drop a table, but someone's still connected to it.

SELECT pg_terminate_backend(pg_stat_activity.pid) 
FROM pg_stat_activity 
WHERE datname = current_database() AND pid <> pg_backend_pid();