This file contains hidden or 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
<?php | |
use Symfony\Component\DomCrawler\Crawler; | |
$crawler = new Crawler('<html><body><select id="my_select"></select></body></html>'); | |
$crawler->filter('select#my_select')->each(function (Crawler $crawler) { | |
$node = $crawler->getNode(0); | |
$option = new \DOMElement('option', 'Option Name'); | |
$node->appendChild($option); |
This file contains hidden or 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
cp -pv --parents $(git diff --name-only sha1 sha2) ../path/to/copy |
This file contains hidden or 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
image: docker/compose | |
options: | |
docker: true | |
pipelines: | |
default: | |
- step: | |
size: 2x # double memory (8GB) for this step | |
script: |
This file contains hidden or 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 DATABASE database; | |
CREATE USER user@localhost IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON database.* TO user@localhost; | |
FLUSH PRIVILEGES; |
This file contains hidden or 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
FROM wordpress:latest | |
WORKDIR /var/www/html | |
RUN apt-get update | |
RUN apt-get install -y curl \ | |
gnupg | |
RUN curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
RUN chmod +x /usr/local/bin/wp | |
RUN wp --info |
This file contains hidden or 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 DATABASE 'my_db'; | |
CREATE USER 'my_user'@'localhost' IDENTIFIED BY 'my_pass'; | |
GRANT ALL PRIVILEGES ON my_db.* TO 'my_user'@'localhost'; | |
FLUSH PRIVILEGES; |
This file contains hidden or 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 a new branch | |
git checkout -b feature/example | |
# do some changes | |
# udpate master | |
git checkout master | |
git pull origin master | |
# rebase with master |
This file contains hidden or 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
var gulp = require('gulp'); | |
var shell = require('gulp-shell'); | |
var prompt = require('gulp-prompt'); | |
var init = { | |
ssh: { | |
user: "", | |
host: "", | |
port: "22", | |
path: "" |
This file contains hidden or 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
<?php | |
// API access key from Google API's Console | |
define('API_ACCESS_KEY', 'your-key'); | |
function pushMessage($title, $body, $sound = true) | |
{ | |
$msg = array ( | |
'body' => substr($body,0,40), // limit body | |
'title' => $title, | |
'click_action' => 'FCM_PLUGIN_ACTIVITY', |
This file contains hidden or 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
<?php | |
// your custom code... | |
add_filter('embed_oembed_html', 'my_embed_oembed_html', 10, 4); | |
function my_embed_oembed_html($html, $url, $attr, $post_ID) { | |
$iframe = str_replace('<iframe', '<iframe class="embed-responsive-item"', $html); | |
$newHtml = '<div class="embed-responsive embed-responsive-16by9">%s</iframe></div>'; | |
$html = sprintf($newHtml, $iframe); | |
return $html; |
NewerOlder