To install Android Studio on Ubuntu 14.04, complete the following steps: First, download the Android Studio here: http://developer.android.com/sdk/index.html The Android Studio requires Java’s JDK 6 or above (preferably 7), so you’ll want to do the following at your command line: sudo apt-get install openjdk-7-jre sudo apt-get install openjdk-7-jdk Or, if you prefer to […]
Month: January 2015
Rails conditional migrations – ensure column does not exist
If you’re running into a rails migration exception, such as: column “x” of relation “y” already exists Then you can conditionally run the associated migration in the following way: YourModel.reset_column_information unless YourModel.column_names.include?(“the_column”) add_column(:your_models, :the_column, :boolean, :default=>true) end Of course, it is probably best to address the underlying workflow issues that caused this issue to […]
Check checkbox with tr element
To check a checkbox after clicking a table’s tr element, do the following: $(document).on(“click”,”.your-tr-element”,function(event){ checkbox = $(this).find(“input:checkbox”); if(event.target.type!=”checkbox”){ if($(checkbox).prop(“checked”) == true){ $(checkbox).prop(“checked”,false); }else{ $(checkbox).prop(“checked”,true); } } }); By retaining the event in the callback function, we’re able to ensure the clicked element is not the checkbox itself. This will solve the issue of effectively […]
chmod only files or directories recursively
To chmod only files or directories recursively, do the following: For files: find . -type f -exec chmod 644 {} ; For directories find . -type d -exec chmod 755 {};
CKeditor – remove top toolbar and bottom toolbar
To use the CKeditor without the top and bottom toolbars, do the following: config.removePlugins = “toolbar,elementspath” config.resize_enabled = false This will remove both the capability to resize the dialog and remove the grey toolbar at the bottom, as well as the entire top toolbar, without the need for CSS modifications. If you’re using the […]