Include node specific JS/CSS in Drupal

 

Did you find this post useful?

Tip me some bitcoin:

Cleanflight on Mac OSX

If you’re having problems getting cleanflight to recognise your Naze board and you’re on a Mac, do the following:

  1. Using USB to connect to the Naze32 requires the installation of the SiLabs CP2102 VCP Drivers. The drivers are available for download directly from the SiLabs Website
  2. Force the serial connection to be recognized by running the following line at the command terminal: sudo ln -s /dev/tty.SLAB_USBtoUART /dev/tty.usbserial
  3. Fire up Cleanflight!

 

Did you find this post useful?

Tip me some bitcoin:

Drupal: How to apply the img-responsive class to all images in your bootstrap subtheme

UPDATE: This is now included by default and should not be used.

In your subtheme’s template.php file, add the following:

 

Did you find this post useful?

Tip me some bitcoin:

What happens when you reach your parse.com request limit?

This is what happens:

IMG_8840

 

 

 

 

 

 

Next: How to cache parse requests…

 

Did you find this post useful?

Tip me some bitcoin:

How to install Drupal with PostgreSQL on Windows 7

So you want to see this?

Drupal database type

 

 

 

 

No problem, just follow my instructions:

  1. Download the latest version of Drupal and extract into c:\dev\drupal
  2. Download and install Postgres
  3. Download EasyPHP and install in c:\dev
  4. Once installed, double click on EasyPHP task menu icon and stop Apache and MySQL
  5. Add the following to your PATH environment variable: C:\Program Files\PostgreSQL\9.4\lib; (or change the path if thats not where you installed Postgres)
  6. Edit your php.ini file (found here: C:\dev\EasyPHP-DevServer-14.1VC9\binaries\php\php_runningversion) and remove the semicolon prededing “extension=php_pdo_pgsql.dll” and “extension=php_pgsql.dll”
  7. Double click on EasyPHP task menu icon and start Apache
  8. Right-click on EasyPHP task menu icon and choose Administer
  9. On the Admin screen, in the Local Files section, add a new alias (name: your-site, path: C:\dev\drupal\drupal-7.38 <- from step 1)
  10. Visit http://127.0.0.1/your-site/ and follow the Drupal setup wizard
  11. Install standard version of Drupal, on database setup screen you will now have the option to choose “PostgreSQL”
  12. From your Start Menu, find PostgreSQL and open “pgAdmin” tool
  13. Right click and choose Connect
  14. Get the database name (postgres), hostname (localhost), port number (5432) and username (postgres) and password (set this yourself)
  15. Enter the details and you’re all set.

 

Did you find this post useful?

Tip me some bitcoin:

How to patch/hotfix your CQ5 website

You can use a package to patch your javascript, if you find a bug in production and dont want to perform a production deploy. In other words, if you need a quick fix…

  1. Make a package containing the file you wish to patch, perhaps a javascript file in your clientlibs, install it in the package manager in your production author.
  2. Go into CRX/DE, drill down to the file you are patching, click on it, click the replication tab, click replicate
  3. Go to the CQ welcome screen, Tools > Replication > Activate Tree > Drill down, select file, activate
  4. Update cachebreaker which will force clientlibs to recompile

 

Did you find this post useful?

Tip me some bitcoin:

Parse.com Javascript SDK + Disqus SSO Integration

Universal code:

When your page content changes and you need to load new comments:

Dependancies:

  • http://code.google.com/p/crypto-js
  • http://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript

Did you find this post useful?

Tip me some bitcoin:

How to get free SSL for your Parse.com hosted app

This tutorial assumes you are using Parse.com hosting (yourapp.parseapp.com) and have applied a custom domain name (yourapp.com) upon which SSL will be used.

  1. Visit startssl.com and signup for a free SSL certificate, save the ssl.key and ssl.cert files when prompted
  2. Visit Settings > Hosting page in your Parse.com dashboard
  3. Upload the file ssl.cert into the SSL Public Certificate field
  4. Go back to startssl.com > Toolbox > Decrypt Private Key, save decrypted file as privatekey.pem
  5. Upload privatekey.pem to Parse.com in the SSL Private Key field

Did you find this post useful?

Tip me some bitcoin:

How to use Backgrid.js and the Parse.com Javascript SDK

Create a Backgrid populated with data from Parse.com and have it auto save back to Parse when a field is edited:

Did you find this post useful?

Tip me some bitcoin:

How to change the orientation of your CC3D flight controller

Normally your CC3D should be mounted with the arrow pointing towards the front of your quadcopter, and the USB towards the back. However, this makes it difficult to plug in the USB cable, so instead you can mount it with the arrow pointing a different direction by using the table below as a guide:

cc3d orientation guide

After you have mounted using a new orientation, launch the OpenPilot GCS software on your computer and connect your CC3D to your USB port. In the configuration tab, click on Attitude. Here you can adjust the values based on the table above, and then click save.

I have my arrow pointing left, so my USB port is easily accessible on the right, therefore the Yaw value is set to 90
I have my arrow pointing left, so my USB port is easily accessible on the right, therefore the Yaw value is set to 90

Important Note:

You must set this value again every time you update or reset the board, or run the calibration wizard (it resets everything)

Did you find this post useful?

Tip me some bitcoin: