Skip to content

Instantly share code, notes, and snippets.

View ahgood's full-sized avatar

Guojun ahgood

  • Fullstack Developer
  • Halifax
View GitHub Profile
//Disable cache
//https://www.drupal.org/node/2598914
//https://www.drupal.org/project/devel
//Update Drupal Core
//https://www.drupal.org/node/2550801
drush pm-update drupal
//Get all taxonomy
//Sites/devdesktop/drupal-8.3.5/core/themes/bartik/bartik.theme
@ahgood
ahgood / process_image.js
Created August 11, 2017 01:21
Merge images, remove image colors, change image contrast and more.
var appHost = '*SERVER_ADDRESS*';
var appId = '*FB_APP_ID*';
window.fbAsyncInit = function() {
FB.init({
appId : appId,
cookie : true,
xfbml : true,
version : 'v2.8'
});
@ahgood
ahgood / create_worksheets.php
Created August 11, 2017 03:30
Create multiple worksheet by PhpSpreadsheet
<?php
/*
Install: composer require phpoffice/phpspreadsheet:dev-develop
Github: https://github.com/PHPOffice/PhpSpreadsheet/
Document: https://phpspreadsheet.readthedocs.io/
*/
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
@ahgood
ahgood / datatable_sorting_by_chinese_pinyin.html
Created August 16, 2017 02:23
Sorting by Chinese Pinyin in Datatable
/*
pinyin_dict_notone.js and pinyinUtil.js is available in URL below:
https://github.com/sxei/pinyinjs
*/
<script src="pinyin_dict_notone.js"></script>
<script src="pinyinUtil.js"></script>
<script>
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
"chinese-string-asc": function(s1, s2) {
s1 = pinyinUtil.getPinyin(s1);
@ahgood
ahgood / gist:4d53f6d9ac1f3c593255fd20b15407e1
Created September 2, 2017 01:33
Setting up proxy(Shadowsocks, socket 5) for Google Backup and Sync(Google Photos Mac App)
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
sudo make install-config
sudo nano /etc/proxychains.conf
add this code to the end of proxychains.conf: socks5 127.0.0.1 1080
proxychains4 open -a /Applications/Backup\ and\ Sync.app
@ahgood
ahgood / promise_examples.js
Created October 6, 2017 13:14
JavaScript Promise Examples
//1.
new Promise(function(resolve, reject) {
console.log('A');
resolve();
}).then(function() {
console.log('B');
});
console.log('C');
//A, C, B
@ahgood
ahgood / cron job delete .DS_Store
Created November 7, 2017 01:34
cron job to delete .DS_Store
0 * * * * find /Users/ahgood -name '.DS_Store' -type f -delete
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@ahgood
ahgood / browser-scrollbar-controls-timelinelite-animation.markdown
Created January 12, 2018 00:48
Browser Scrollbar Controls TimelineLite Animation

Browser Scrollbar Controls TimelineLite Animation

This is a test showing how the browser's vertical scrollbar can control a Greensock TimelineLite animation.

A Pen by Adrian Parr on CodePen.

License.

@ahgood
ahgood / index.html
Created January 12, 2018 02:00
TweenMax (slideToggle) height:auto
<div class="expander">
<div class="header">Click Me</div>
<div class="content">I have an accordion and am animating the the height for a show reveal - the issue is the height which i need to set to auto as the information is different lengths.<br><br>
I have an accordion and am animating the the height fferent lengths.
</div>
</div>
<div class="expander">