Skip to content

Instantly share code, notes, and snippets.

View nttan's full-sized avatar

Nguyen Tan nttan

View GitHub Profile
@nttan
nttan / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nttan
nttan / SiteConfig.php
Last active August 29, 2015 14:15
add button on Backend Silverstripe CMS
$importLetMCbutton = FormAction::create('manualimport_LetMC', 'Start Import with LetMC')
->addExtraClass('ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary')
->setAttribute('data-icon', 'accept')
->setButtonContent('<span class="ui-button-icon-primary ui-icon btn-icon-accept"></span><span class="ui-button-text">Start Import with LetMC</span>')
->setUseButtonTag(true);
@nttan
nttan / gist:4a94d2af6aa46372f09b
Created February 12, 2015 02:02
Doctrine 2 document
https://github.com/TomasVotruba/awesome-doctrine
@nttan
nttan / gist:c7c8a6e0e644ab8420ec
Last active August 29, 2015 14:15
cài macos song song window
https://www.youtube.com/watch?v=duVRKVJCmSo
https://www.youtube.com/watch?v=NaMQZK41_Zw&index=6&list=TL6QV_CkXCFtg
@nttan
nttan / install mysql on fedora
Last active August 29, 2015 14:17
install mysql on fedora #fedora
link
https://developer.jboss.org/wiki/InstallMySQLonFedora?_sscc=t
http://www.linuxers.org/howto/how-install-mysql-server-fedora
@nttan
nttan / gist:da57dd75c9d25052b9bd
Created April 26, 2015 09:30
GIT: Save user and Password when use git
git config --global credential.helper store
@nttan
nttan / salesforce.js
Created October 19, 2015 04:41 — forked from mobyjames/salesforce.js
Squarespace Forms Integration for Salesforce
Y.namespace('Template').Salesforce = Class.create({
/*
baseUrl
oid
sqsFormSubmit
*/
initialize: function (config) {
this.config = config;
},
http://www.integralist.co.uk/posts/git-tips.html
SELECT `main_table`.* FROM `quote` AS `main_table` WHERE (`is_active` = '1') AND (`items_count` > 0) ORDER BY entity_id DESC
############################################
$this->_logger->info(sprintf("Start cron update Quote - Total: %s", implode(',',$quotes->getColumnValues('entity_id'))));
// echo 'SM\Quote\Model\Observer';die;
// die;
foreach ($quotes as $quote) {
$items = $quote->getAllVisibleItems();
// echo get_class($items);die;
if (sizeof($items) > 0) {
elasticsearch-php
=================
[![Build Status](https://img.shields.io/travis/elastic/elasticsearch-php.svg?style=flat-square)](https://travis-ci.org/elastic/elasticsearch-php)
Official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in PHP; because of this it tries to be opinion-free and very extendable.
To maintain consistency across all the low-level clients (Ruby, Python, etc), clients accept simple associative arrays as parameters. All parameters, from the URI to the document body, are defined in the associative array.