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 ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
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
<?php | |
$v = "0"; | |
if ($v) { | |
echo "truthy"; | |
} else { | |
echo "falsy"; | |
} |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# TODO: https://gist.github.com/rrosiek/8190550 | |
# TODO: replace with php7 | |
# apt-get install php5 php5-cli php5-xdebug php5-mysql libapache2-mod-php5 php5-curl -y | |
$script = <<SCRIPT | |
echo Provisioning... |
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
Plugin 'AndrewRadev/sideways.vim' | |
" Move function arguments left or right | |
" https://github.com/AndrewRadev/sideways.vim | |
:set winaltkeys=no | |
execute "set <M-h>=\eh" | |
execute "set <M-l>=\el" | |
nnoremap <M-h> h | |
nnoremap <M-l> l |
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
var ajax = { | |
/** | |
* Example: | |
* <code> | |
* ajax.get('/definition', { id: 42 }) | |
* .fail(function() { | |
* console.log('We failed to retrieve definition! Do something else.'); | |
* }) | |
* .done(function(definition) { | |
* console.log(definition); |
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
/** | |
* Example: | |
* <code> | |
* var ajax = require('./ajax.js'); | |
* | |
* ajax.get('/definition', { id: 42 }) | |
* .fail(() => { | |
* console.log('We failed to retrieve definition! Do something else.'); | |
* }) | |
* .done((definition) => { |
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
# | |
# deb cdrom:[Debian GNU/Linux 7 _Wheezy_ - Official Snapshot amd64 LIVE/INSTALL Binary 20141121-01:47]/ wheezy main | |
#deb http://ftp.us.debian.org/debian/ wheezy main | |
#deb-src http://ftp.us.debian.org/debian/ wheezy main | |
#deb http://security.debian.org/ wheezy/updates main | |
#deb-src http://security.debian.org/ wheezy/updates main | |
# wheezy-updates, previously known as 'volatile' | |
#deb http://ftp.us.debian.org/debian/ wheezy-updates main |
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
<?php | |
// Transactions. Any exception in the closure | |
// will rollback the transaction. Otherwise the transaction | |
// will be automatically committed. | |
$id = $_POST['id']; // from input, no need for escaping, it's done by DB (PDO). | |
DB::transaction(function() use($id) { | |
DB::update('UPDATE account SET balance = balance - ? WHERE id = ?', [500, $id]); |
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
$sql = 'SELECT SQL_CALC_FOUND_ROWS | |
_user.id AS id, | |
_user.firstname AS firstname, | |
_user.surname AS surname, | |
wp.title AS workplace, | |
SUM(IF(ug.id IS NOT NULL, 1,0)) AS num_goals, | |
SUM(IF(ug.status = 2, 1,0)) AS num_active_goals | |
FROM _user | |
LEFT JOIN workplace wp ON _user.workplace_id=wp.workplace_id | |
LEFT JOIN _user_goal ug ON _user.id=ug.fk_user |
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
<!-- https://jsfiddle.net/1u9sezp4/ --> | |
<form> | |
<label>Description</label><br /> | |
<textarea name="description"></textarea> | |
<br /> | |
<label>Evaluation</label><br /> | |
<textarea name="evaluation"></textarea> | |
<br /> | |
NewerOlder