(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// This will open up a prompt for text to send to a console session on digital ocean | |
// Useful for long passwords | |
(function () { | |
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split(""); | |
function f() { | |
var character = t.shift(); | |
var i=[]; | |
var code = character.charCodeAt(); | |
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1 |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
server { | |
server_name domain.tld www.domain.tld; | |
root /var/www/project/web; | |
location / { | |
# try to serve file directly, fallback to app.php | |
try_files $uri /app.php$is_args$args; | |
} | |
# DEV | |
# This rule should only be placed on your development environment |
var account = { | |
warehouseId: 'warId', | |
warehouseHandler: function(){ | |
this.warehouseId.on('click',funciton(){}) | |
} | |
}; | |
$(funciton(){ | |
account.warehouseHandler(); | |
}) |
{ | |
size: # number of results to return (defaults to 10) | |
from: # offset into results (defaults to 0) | |
fields: # list of document fields that should be returned - http://elasticsearch.org/guide/reference/api/search/fields.html | |
sort: # define sort order - see http://elasticsearch.org/guide/reference/api/search/sort.html | |
query: { | |
# "query" object following the Query DSL: http://elasticsearch.org/guide/reference/query-dsl/ | |
# details below | |
}, |
<?php | |
namespace frontend\components; | |
use yii\web\UrlManager; | |
use common\models\Lang; | |
class LangUrlManager extends UrlManager | |
{ | |
public function createUrl($params) | |
{ |
//Adds new user group "dev" using Mac directory service command line utility | |
sudo dscl . -create /groups/dev | |
//Assigns some group id for the newly created group | |
sudo dscl . -append /groups/dev gid 2111 | |
//Assigns password for the group | |
sudo dscl . -append /groups/dev passwd "xxxxx" |
<?php | |
/** | |
* Yii bootstrap file. | |
* Used for enhanced IDE code autocompletion. | |
*/ | |
class Yii extends \yii\BaseYii | |
{ | |
/** | |
* @var BaseApplication|WebApplication|ConsoleApplication the application instance | |
*/ |
# Created Tue May 5 13:28:50 EEST 2015 | |
<VirtualHost *:80> | |
DocumentRoot "/Users/md101/Sites/business-card.local/frontend/web" | |
ServerName business-card.local | |
#ServerAlias your.alias.here | |
ScriptAlias /cgi-bin "/Users/md101/Sites/business-card.local/cgi-bin" | |
<Directory "/Users/md101/Sites/business-card.local/frontend/web"> | |
Options All | |
AllowOverride All |