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
{ | |
"Create new functional component": { | |
"prefix": "_compo", | |
"body": [ | |
"import React from 'react';", | |
"import PropTypes from 'prop-types';", | |
"", | |
"export const $1 = ({$2}) => (", | |
" $3", | |
");", |
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
# config/php/Dockerfile | |
FROM php:7.0-fpm | |
RUN apt-get update | |
RUN apt-get install -y zlib1g-dev && docker-php-ext-install -j$(nproc) zip | |
RUN \ | |
apt-get install -y libpng-dev libjpeg62-turbo-dev libfreetype6-dev && \ | |
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ | |
docker-php-ext-install -j$(nproc) gd |
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
const typeFinder = type => function* (params = {}, ref = 'master') { | |
const search = function* (searchParams) { | |
const Api = yield initApi; | |
const reference = ref === 'master' ? Api.master() : ref; | |
const preparedForm = Api.form('everything') | |
.ref(reference) | |
.pageSize(200); | |
const predicates = []; |
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
#!/usr/bin/env bash | |
# Install common environment | |
apt-get update | |
apt-get install -y curl | |
# Install Git and configure it (useful when working on Windows) | |
apt-get install -y git-core | |
git config --global color.ui auto | |
git config --global core.filemode false |
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
mysqldump --opt --where="1 limit 1000000" database table > dump.sql |
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 |