Instantly share code, notes, and snippets.

View gist:42810c2433401d173227254bbfb94cbe
/Applications/ -dump-prefs -logger=machine -hardware /Applications/ -hardware /Users/lloydleung/Library/Arduino15/packages -tools /Applications/ -tools /Applications/ -tools /Users/lloydleung/Library/Arduino15/packages -built-in-libraries /Applications/ -libraries /Users/lloydleung/Documents/Arduino/libraries -fqbn=rambo:avr:rambo -ide-version=10808 -build-path /var/folders/zw/919kfbjd28vb3yx642z5st6m0000gn/T/arduino_build_22011 -warnings=none -build-cache /var/folders/zw/919kfbjd28vb3yx642z5st6m0000gn/T/arduino_cache_418922 -prefs=build.warn_data_percentage=75
View gist:ccee6e8bfb6a4b9b6f515402c0720180
--(1755:Sun,11 Nov 18:$ )-- composer -vv install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Dependency resolution completed in 0.001 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove symfony/symfony v3.4.18
- don't install symfony/symfony v3.4.18|remove symfony/templating v4.1.7
View gist:b84c75f860a82c87cd857b9b0fdb73f0
--(1754:Sun,11 Nov 18:$ )-- composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-http * is missing from your system. Install or enable PHP's http extension.
View SquareCropApprovalRequiredSubscriber.php
namespace ContestEngineBundle\Service\EventSubscriber;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\EventSubscriber;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class SquareCropApprovalRequiredSubscriber implements EventSubscriber
View Doctrine2-oneToMany.php
$A = 'Product';
$B = 'Feature';
echo <<< EOD
View gist:723921da68749328c751f1aae78f4d52
$criteria = Criteria::create()->where(Criteria::expr()->eq("id", $listId));
$desiredList = $property->getLists()->matching($criteria);
## $desiredList is an empty ArrayCollection()
## The following works:
View blink.c
View excelMergeContents.vba
' This excel subroutine that will merge the contents of a selected range,
' concantenate and move all the contents into into the top cell.
' keywords: merge, cell, concatenate, join, range, selection
' The MIT License (MIT)
' Copyright (c) 2016 Lloyd Leung
' Permission is hereby granted, free of charge, to any person obtaining a
' copy of this software and associated documentation files (the "Software"),
View chat-frontend.js
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
View gist:10133064
Sub convert_all_inline_shapes()
Dim s As InlineShape
For Each s In ActiveDocument.InlineShapes
If s.Type = wdInlineShapeLinkedPicture Then
' use debug print to get a list of images converted.. not necessary though...
Debug.Print s.Type & " <>"
s.LinkFormat.SavePictureWithDocument = True