Skip to content

Instantly share code, notes, and snippets.

View SmellyFish's full-sized avatar

Nikita Makeyev SmellyFish

View GitHub Profile
{
"TableStatistics": [
{
"ValidationPendingRecords": 0,
"Inserts": 0,
"ValidationState": "Validated",
"ValidationSuspendedRecords": 0,
"LastUpdateTime": 1533835859.881,
"FullLoadErrorRows": 0,
"FullLoadCondtnlChkFailedRows": 0,
@SmellyFish
SmellyFish / output.log
Created August 3, 2018 19:33
Alert logic boot log
�%Gcat: /proc/self/attr/current: Invalid argument
Welcome to CentOS
Starting udev: %G[ OK ]
Home Page,New Products,Specials,My Account,Contact Us,精選貨品,精选货品,主題,主题,分類,分类,新到貨品,新到货品,我的帳戶,我的帐户,聯絡我們,联络我们,購物袋,购物袋,個人用品,个人用品,家居用品,文具,禮品及其他,礼品及其他,創意花藝,创意花艺,創意工作坊,创意工作坊,,「紅白藍330」x 又一山人合作品牌,「红白蓝330」x 又一山人合作品牌,Chocolate Rain 產品,Chocolate Rain 产品,「香港情懷」產品,「香港情怀」产品,新生會紅白藍產品,新生会红白蓝产品,香港手信及旅遊系列,賀年貨品,贺年货品,磁石貼,磁石贴,紅白藍330 x 又一山人合作品牌,红白蓝330 x 又一山人合作品牌,「香港情怀」磁贴产品,「香港情懷」磁貼產品,2016新產品,2016新产品,2017新產品,2017新产品,訂製企業禮品,订制企业礼品,精選貨品,精选货品,主題,主题,分类,新到貨品,新到货å“
nmakeyev-ltm:cc-vagrant nmakeyev$ vagrant status
Current machine states:
ccbox not created (virtualbox)
The environment has not yet been created. Run `vagrant up` to
create the environment. If a machine is not created, only the
default provider will be shown. So if a provider is not listed,
then the machine is not created for that environment.
nmakeyev-ltm:cc-vagrant nmakeyev$ vagrant up
try {
$connection->beginTransaction();
$connection->exec($insertQuery, $insertValues);
if ($lastProspectId) {
$listEmail->setClientType($lastProspectId);
$listEmail->save($connection);
}
$connection->commit();
@SmellyFish
SmellyFish / index.php
Created June 3, 2016 17:07
Test array vs fixed array memory usage
<?php
$limit = 100000;
$arr1 = array();
for ($i = 0; $i < $limit; $i++) {
$arr1[$i] = rand(1, $limit);
}
$startMemoryUsage = memory_get_usage();
$arr2 = array();
@SmellyFish
SmellyFish / gist:93b22f52baaebf3f0628
Created March 14, 2016 21:09
Prasad stock solution
// given an array of prices, determine the largest profit that can be made
[310, 315, 275, 295, 260, 270, 290, 230, 255, 250]
private int findMaxProfit(int[] stockPrices) {
int maxProfit = 0;
// TODO: Implement later
validateStockPrices();
protected function createInfluenceObject($accountId, $opportunityId, $touchId, $prospectId, $campaignId,
$touchCreatedAt, $oppCreatedAt, $oppIsClosed, $oppClosedAt, $influence = null)
{
if (empty($influence)) {
$influence = new \piOpportunityInfluence();
}
$influence->account_id = $accountId;
$influence->opportunity_id = $opportunityId;
$influence->campaign_touch_id = $touchId;
$influence->prospect_id = $prospectId;
@SmellyFish
SmellyFish / gist:0aee8256466efc64e021
Created September 24, 2014 19:46
CoreCommerce: prepping release branch
# Make sure local master is up to date
$ git checkout master
$ git fetch origin
$ git merge origin/master
# Fix conflicts, commit and push
# Make sure local development is up to date
$ git checkout development
$ git merge origin/development
# Fix conflicts, commit and push
# Merge master into development
@SmellyFish
SmellyFish / Search Box Code
Created April 4, 2014 17:18
Google CSE Examples
<script>
(function() {
var cx = 'your_cx_code_goes_here';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);