This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove an element at desired index | |
a.splice(desiredIndex, 1); | |
// Add an element at given index | |
a.splice(desiredIndex, 0, "My new element"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sitemap = new \DOMDocument(); | |
$sitemap->loadXml($feedGenerator->generate()); | |
$xpath = new \DOMXPath($sitemap); | |
$xpath->registerNamespace('image', 'http://www.google.com/schemas/sitemap-image/1.1'); | |
$image = $xpath->evaluate('//image:image'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function updateLastUpdateDate(LifecycleEventArgs $eventArgs) | |
{ | |
$changeSet = $eventArgs->getEntityManager()->getUnitOfWork()->getEntityChangeSet($this); | |
if (!array_key_exists('status', $changeSet)) { | |
return; | |
} | |
// $statusBefore = $changeSet['status'][0]; | |
// $statusAfter = $changeSet['status'][1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install build-essential module-assistant | |
m-a prepare | |
# Install Guest Additions from VBox menu | |
mount /media/cdrom | |
sh /media/cdrom/VBoxLinuxAdditions.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-agent bash | |
ssh-add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Sample configuration file for the Samba suite for Debian GNU/Linux. | |
# | |
# | |
# This is the main Samba configuration file. You should read the | |
# smb.conf(5) manual page in order to understand the options listed | |
# here. Samba has a huge number of configurable options most of which | |
# are not shown in this example | |
# | |
# Some options that are often worth tuning have been included as |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install PostGreSQL | |
sudo apt-get install postgresql | |
# Create user | |
sudo -i -u postgres | |
psql | |
CREATE USER username; | |
ALTER ROLE username WITH CREATEDB; | |
# Create database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sS https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/ | |
sudo ln -s /usr/local/bin/composer.phar /usr/local/bin/composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Decoding | |
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table; | |
-- Encoding | |
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |