# get list of container id
docker ps
# launch bash into container
# prefix with winpty if no terminal available (Windows)
winpty docker exec -it <id> bash
# Install an editor
apt-get update
Scrutinizer with code coverage YOURLS with PHPCS
- me: https://github.com/MY/REPO
- PR: https://github.com/THEM/REPO on branch
patch-1
$ git checkout -b THEM-patch-1 master
$ git pull https://github.com/THEM/REPO.git patch-1
$ git commit --allow-empty -m "Trigger build"
$ git push https://github.com/THEM/REPO.git THEM-patch-1:patch-1
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
<NotepadPlus> | |
<UserLang name="Markdown" ext="mkdn mkd md" udlVersion="2.0"> | |
<Settings> | |
<Global caseIgnored="yes" allowFoldOfComments="no" forceLineCommentsAtBOL="no" foldCompact="no" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments" id="0">00# 00## 00### 00#### 00##### 01 02 03<!-- 04--></Keywords> | |
<Keywords name="Numbers, additional" id="1"></Keywords> | |
<Keywords name="Numbers, prefixes" id="2"></Keywords> |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Typing Speed Test — How fast can you type ?</title> | |
<style type="text/css"> | |
#o_keypressed, #o_wordok, #o_wordnotok {zdisplay:none;} | |
#o_typein{font-size:21px; margin:15px;padding-top:6Opx;display:none;} | |
body {font:16px Verdana,Arial} | |
#timer {font-size:30px; color: #494;background:#efe; border:1px solid #cdc; width:100px; height:80px; float:left; margin:0 10px; text-align:center} |
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 | |
function map($items, $func) | |
{ | |
$results = []; | |
foreach ($items as $item) { | |
$results[] = $func($item); | |
} | |
return $results; | |
} |
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 | |
# with a callback | |
$sizeLimit = 100000; | |
curl_setopt($ch, CURL_PROGRESSFUNCTION, function ($ch, $totalBytes, $receivedBytes) use ($sizeLimit) { | |
if ($totalBytes > $sizeLimit) { | |
return 1; // return non-zero value to abort transfer | |
} | |
}); |
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 | |
function ut_var_dump( $what ) { | |
ob_start(); | |
var_dump( $what ); | |
$display = ob_get_contents(); | |
ob_end_clean(); | |
fwrite( STDERR, $display ); | |
} |
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 total = 0; | |
var items = 0; | |
$('.sale-info').each( function(i,e){ | |
var price = $(e).find('.price').text().replace('$',''); | |
var sales = $(e).find('.sale-count').text().replace(' Sales',''); | |
total = total + ( price * sales ); | |
items++; | |
}); | |
alert( '$' + total + ' with ' + items + ' items'); |
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
-- substract 3 hours | |
UPDATE `wp_posts` | |
SET `post_date` = DATE_ADD( `post_date`,INTERVAL -3 HOUR ) | |
WHERE post_status = 'publish'; |