Posts

Showing posts with the label github

edx-platform - How to make SMTP work on your Open EdX instance the proper way

There were several threads in the Open EdX mailing list asking about how to make the email working. But, it seams like there is no proper instructions out there to help people. So, I decided to write something about that. Firstly, there are 3 simple things to keep in mind: All the authentication information should be kept privately. If you add them to the edx-platform source files there will be conflicts when you upgrade or pull from master/branches. So, the best place to keep all the settings for all your Open edX applications is /edx/app/edx_ansible/server-vars.yml .  0. Checkout all of your modification on: (to avoid source code conflicts) cms/envs/common.py lms/envs/aws.py cms.env.json cms.auth.json lms.env.json lms.auth.json 1. Create  server-vars.yml   in  / edx/app/edx_ansible/ 2. Add these following variables to server-vars.yml with your SMTP information: EDXAPP_EMAIL_BACKEND: 'django.core.mail.backends. smtp.EmailBackend' EDXAPP_EMAIL_HOST: '...

Add custom javascript to your WordPress theme without touching the template code

Image
Sometimes you want to add some custom effect to your WordPress template but don't want to make any changes to the theme code. Here you go, use this New Custom Javascript Editor plugin in your WordPress instance: Github repository: https://github.com/dangtrinh/Custom-Javascript-Editor 1. Install $ cd /path/to/your/wordpress/doc/root/wp-content/plugins $ git clone https://github.com/dangtrinh/Custom-Javascript-Editor 2. Activate the New Custom JavaScript Editor in your WordPress Admin Dashboard 3. Go to Appearance >> Custom JavaScript  or this url: http://yourdomain.com/wp-admin/themes.php?page=custom-javascript 4. Add your custom javascript and click Update

Get last published posts in your entire WordPress Multisite network

To display last published posts from the entire network on the main blog of your WordPress Multisite, you can use this plugin I wrote (*) yesterday: Github repo:   https://github.com/dangtrinh/WordPress_Multisites_Utilities_Plugin 1. Install the WordPress Multisite Utilities Plugin: $ cd /var/www/your_wordpress_installation/wp-content/plugins $ git clone https://github.com/dangtrinh/WordPress_Multisites_Utilities_Plugin 2. Activate the plugin for your network (network only) 3. In your home page template file (for example page-home.php), call the  get_recent_network_posts function to get latest posts (6 posts by default) from your network. For example: <?php $lastposts = get_recent_network_posts(); foreach( $lastposts as $post): ?> <div class="col-1-3"> <div class="blog-post"> <div class="blog-post-thumbnail" style="background-image: url('<?php echo $post['thumb_url'];?>')"...

Google Code is being shutting down

Chris DiBona, Director of Open Source of Google just announced yesterday that Google will close its code repository service in about ten months and stop accepting new repo creation. They also provide some migration tools for developers: Google Code to GitHub exporter tool : http://code.google.com/export-to-github Stand-alone tools :  https://code.google.com/p/support-tools/ It quite a memory to me that Google Code is the first free repository service I used since I still was a student. It's not as great as Github but it's the only one available back then. References: [0] http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html [1]  http://www.wired.com/2015/03/github-conquered-google-microsoft-everyone-else/

Google Drive API - Feeling the openness of Google

I'm currently working on a project that need to migrate all my organization documents (of all users) which hosted on Google App to a new domain (also on Google App) So, the process is: 1. Using a Service Account of the old domain to read all files and folders of all user in the old domain along with their current sharing permissions. 2. For each file / folder, share with the relevant new accounts in the new domain. 3. In the new domain, make a copy of each shared file / folder by another Service Account of this new domain. 4. Apply the old sharing permissions to the same file in the new domain. 5. In the old domain, remove shared permissions to new domain accounts. Service Account is a special account used by the application (this) with the domain-wide privileges. It can manipulate all files and folders of all accounts in the domain. ( https://developers.google.com/drive/delegation ) I've just played around with the api documentations and have some utility func...