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 http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Authenticatable | |
# Poner en el modelo User | |
def special_condition_is_valid? | |
permitted_emails = [ | |
# Poner acá los emails permitidos para acceder | |
"[email protected]", | |
"[email protected]" | |
] | |
if permitted_emails.include?(self.email) |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="font" > | |
<edit mode="assign" name="rgba" > | |
<const>rgb</const> | |
</edit> | |
</match> | |
<match target="font"> | |
<edit mode="assign" name="lcdfilter"> |
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
#!/bin/bash | |
pg_dump -i -h <hostname> -p 5432 -U <user> -F c -b -v -f /tmp/<filename>.sql <database_name> | |
pg_restore -i -h <local_hostname> -p 5432 -U <user> -d <database_name> -v /tmp/<filename>.sql |
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
/etc/hosts | |
/var/lib/mysql/ | |
/etc/nginx/sites-available | |
/etc/nginx/nginx.conf # maybe? |
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 LaravelBook\Ardent\Ardent; // it can be Eloquent too | |
class BaseModel extends Ardent { | |
protected $_name; | |
public static function optionList($attribute = 'name') { | |
$model = static::getModel(); |
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
server { | |
client_body_in_file_only clean; | |
client_body_buffer_size 32K; | |
client_max_body_size 300M; | |
sendfile on; | |
send_timeout 300s; | |
# Port that the web server will listen on. | |
#listen 80; |
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 | |
/** | |
* this is a fix mainly for wordpress, to prevent xml error | |
* | |
* this solution is from http://www.vichaunter.com/desarrollo-web/solucion-para-error-line-2-column-6-xml-declaration-allowed-start-document-wordpress | |
* | |
*/ | |
function ___wejns_wp_whitespace_fix($input) { | |
/* valid content-type? */ |
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
apt-get install php5-dev php-pear make mongodb | |
pecl install mongo | |
echo 'extension=mongo.so' > /etc/php5/mods-available/mongodb.ini | |
cat /etc/php5/mods-available/mongodb.ini | |
ln -s /etc/php5/mods-available/mongodb.ini /etc/php5/fpm/conf.d/20-mongodb.ini | |
service php5-fpm restart |
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
server { | |
listen 80; | |
server_name www.example.com; | |
root /var/www/vhosts/example.com/public/; | |
location / | |
{ | |
index index.php index.html index.htm; | |
} |