Skip to content

Instantly share code, notes, and snippets.

Hailong

Block or report user

Report or block Hailong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Hailong
Hailong / my.cnf
Created Jun 29, 2019 — forked from kenelliott/my.cnf
16CPU / 16GB My.cnf
View my.cnf
[mysqld_safe]
nice = -15
[mysqld]
max_binlog_size = 256M #max size for binlog before rolling
expire_logs_days = 1 #binlog files older than this will be purged
## Per-Thread Buffers * (max_connections) = total per-thread mem usage
thread_stack = 256K #default: 32bit: 192K, 64bit: 256K
sort_buffer_size = 1M #default: 2M, larger may cause perf issues
@Hailong
Hailong / Index.php
Last active May 9, 2019
Fix ShipStation plugin for Magento 2.3
View Index.php
<?php
namespace Auctane\Api\Controller\Auctane;
use Exception;
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Framework\App\RequestInterface;
class Index extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface
{
@Hailong
Hailong / 000 - Magento .gitignore
Created Dec 11, 2018 — forked from dfelton/000 - Magento .gitignore
.gitignore for Magento 1.9 projects
View 000 - Magento .gitignore
##
# Magento stuff.
##
downloader/.cache/*
downloader/cache.cfg
downloader/connect.cfg
maintenance.flag
media/*
media/**
var/*
@Hailong
Hailong / gist:2f0b4dfc983dab2b73358716eb7d1220
Created Sep 6, 2017 — forked from elebescond/gist:1433137
Generate a pot template from a wordpress theme - xgettext
View gist:2f0b4dfc983dab2b73358716eb7d1220
find . -iname "*.php" > /tmp/my_theme_file_list.txt
# new template
xgettext --from-code=utf-8 -d my_theme -f /tmp/my_theme_file_list.txt --keyword=__ -o languages/my_theme.pot
# update template
xgettext --from-code=utf-8 -d my_theme -j -f /tmp/my_theme_file_list.txt --keyword=__ -o languages/my_theme.pot
@Hailong
Hailong / gist:c705a490d6e1eb31f3402bb19286a16a
Created Nov 22, 2016
Set up Mautic dev environment quickly.
View gist:c705a490d6e1eb31f3402bb19286a16a
#!/bin/bash
# 1. Check out the latest code from https://github.com/mautic/mautic
# 2. Run 'composer install' in the root directory as described in the README file.
# 3. Run the following script to set the folder permissions correctly. NOTE: change the "my_linux_account" and "web_daemon_account" properly according your sever.
my_linux_account="root"
web_daemon_account="apache"
@Hailong
Hailong / default.vcl
Last active Nov 25, 2018
Varnish 4 VCL for Prestashop 1.6 (*** This is still under development, don't use it directly! ***)
View default.vcl
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
@Hailong
Hailong / README.md
Last active Aug 29, 2015 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js
View README.md

To run this, you can try:

curl -ks https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
@Hailong
Hailong / makeapp.sh
Last active Aug 29, 2015 — forked from demonbane/makeapp.sh
Create a Fluid-style app launcher for single-window Chrome instances on OSX
View makeapp.sh
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
You can’t perform that action at this time.