Skip to content

Instantly share code, notes, and snippets.

View mgmgpyaesonewin's full-sized avatar
🐒
coding

Pyae Sone Win mgmgpyaesonewin

🐒
coding
View GitHub Profile
@mgmgpyaesonewin
mgmgpyaesonewin / mapState.js
Created September 25, 2018 02:16
how to map state from store vuex
<script>
import { mapState } from 'vuex';
export default {
name: 'Player',
computed: mapState('player', {
currentState: 'currentState',
currentMedia: 'currentMedia',
progress: 'progress'
}),
methods: {
delete_booking(code) {
this.get_id_by_code(code, (id) => {
this.$store.dispatch('delete_booking', id)
.then(() => {
this.$toasted.show('Deleted successfully');
this.status = false;
})
.catch(() => this.$toasted.show('Something went wrong'));
});
},
function isOperator(c) {
return c == '+' || c == '-' || c == '*' || c == '/' || c == '^';
}
function leftAssoc(c) {
return c != '^';
}
function priority(c) {
if (c == '^') return 3;
function renderFullPage(html, preloadedState) {
return `
<!doctype html>
<html>
<head>
<title>Redux Universal Example</title>
</head>
<body>
<div id="root">${html}</div>
<script>

To Run, use


./vendor/bin/phpunit

@mgmgpyaesonewin
mgmgpyaesonewin / Ubuntu_Nginx_PM2_Nodejs.md
Last active March 14, 2019 11:40
Ubuntu / Nginx / PM2 / Nodejs installation

Nginx

Install

  • sudo apt-get install nginx

CMD

  • sudo systemctl status nginx
  • sudo systemctl start nginx
  • sudo systemctl restart nginx
  • sudo nginx -t # Check nginx syntax.
@mgmgpyaesonewin
mgmgpyaesonewin / cmd.sh
Last active August 5, 2019 06:19
Linux useful cmd
sudo service php7.2-fpm restart
for display enabled php version in terminal by php -v. we need to set update cli version of php.
use below command to update php cli version
// change terminal (cli) version (7.2 to 7.1)
sudo update-alternatives --set php /usr/bin/php7.1
// routerlink-with-string-interpolation-in-vue
<router-link :to='`/patients/detail/${props.row.id}`'>
<i class="fa fa-eye" aria-hidden="true"></i>
</router-link>
$faker = \Faker\Factory::create();
$tomorrow = Carbon::createFromTimeStamp($faker->dateTimeBetween('now', '+01 days')->getTimestamp());
$end_time = Carbon::createFromFormat('Y-m-d H:i:s', $tomorrow)->addHours(3);

Render your theme:

tutor config render --extra-config ./indigo/config.yml ./indigo/theme "$(tutor config printroot)/env/build/openedx/themes/indigo"

Rebuild the Openedx docker image:

tutor images build openedx

Restart your platform: