If you have to extend an existing object with additional property, always prefer Vue.set()
over Object.assign()
(or spread operator).
Example below explains implications for different implementations.
/* | |
Hoje não deixaremos mais ninguém no vácuo no whatsapp | |
Para utilizar: | |
- Abra o web.whatsapp.com; | |
- Abra o console e cole o código que está no gist; | |
- Aguarde e verá uma mensagem sendo enviada a cada momento que alguém te enviar alguma mensagem. | |
Confira também como ser chato no whatsapp: https://gist.github.com/mathloureiro/4c74d60f051ed59650cc76d1da0d32da | |
e como ser chato no mensseger: https://gist.github.com/mathloureiro/d3f91d19cf148838217e42a0c6df5ed8 | |
*/ |
#!/usr/bin/env bash | |
read -r -d '' usage << EOM | |
Usage: | |
gh-deploy-clone user/repo [ENVIRONMENT] | |
EOM | |
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1 |
As someone that regularly has multiple SSH/VPN sessions open, it can be a huge inconvience to lose all the connections when I lock my screen to get up to go to a meeting, lunch, etc. This is especially true for those connections that require two factor authentication. So, how can I tell my MacBook to keep those connections alive, even though my screen is locked?
Well, turns out that it is pretty simple. All that is needed is to run the following command.
cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO
This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.
The Atom documentation is excellent. It's highly worth reading the flight manual.
On every WP site I do, where i'm the only developer, I add this to the config | |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | |
<? | |
define('WP_HOME', 'http://'.$_SERVER['SERVER_NAME']); | |
define('WP_SITEURL', 'http://'.$_SERVER['SERVER_NAME']); | |
?> | |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | |
But my Localhost/dev-enviroment I setup my own domain, such as http://website.pp (.pp = .paulypops; it's just something that doesn't exist outside of my network). | |
But sometimes I also do the following if I've got a few collegues |
<?php | |
/* | |
* Add "Formats" dropdown to TinyMCE Editor | |
*/ | |
function matt2015_mce_formats($buttons) { | |
array_unshift($buttons, 'styleselect'); | |
return $buttons; | |
} | |
add_filter('mce_buttons_2', 'matt2015_mce_formats'); |
// assertions/compareScreenshot.js | |
var resemble = require('resemble'), | |
fs = require('fs'); | |
exports.assertion = function(filename, expected) { | |
var screenshotPath = 'test/screenshots/', | |
baselinePath = screenshotPath + 'baseline/' + filename, | |
resultPath = screenshotPath + 'results/' + filename, | |
diffPath = screenshotPath + 'diffs/' + filename; |
Ironically, Sails is actually becoming less and less MVC focused internally (see https://github.com/sails101/like-express for an example of what you can do now) On a separate note, I've been gradually working on making the Express dep optional in sails core for a while now. Features like views/static middleware/the orm/etc should be swappable IMO, e.g. you might only need/want socket.io. That was the whole idea of the "hooks" thing in 0.9 (original proposal.
So anyways I thought it might be useful to list how I'm applying Express 3 in Sails as a data point/use case:
Nowadays, Sails core (minus the cli) is essentially:
By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk.
This process is outlined at the Nginx ngx_http_fastcgi_module page manual page.