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
products = Spree::Product.all | |
products.each do |p| | |
p.stock_items.first.set_count_on_hand 10 | |
end |
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
all.each{ |product| product.additional.map{ |propkey, propval| propval = propval.gsub("\n ", "").gsub("\n", "") }} |
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
server { | |
listen [::]:80; | |
listen 80; | |
server_name $NOSSL_SERVER_NAME; | |
access_log /var/log/nginx/${APP}-access.log; | |
error_log /var/log/nginx/${APP}-error.log; | |
location / { | |
gzip on; |
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
SHOW FULL COLUMNS FROM footer_menu_items; | |
ALTER TABLE footer_menu_items MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci; |
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
#!/bin/bash | |
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon -s | |
sudo vi /etc/fstab | |
echo "/swapfile none swap sw 0 0" >> /etc/fstab | |
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
#!/bin/bash | |
postgres -D /usr/local/var/postgres |
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
#!/bin/bash | |
mkdir .vim && git clone https://github.com/scrooloose/nerdtree.git .vim && touch .vimrc | |
echo -e ":nmap <F1> :rew <Enter>\n:nmap <F12> :n <Enter>\nset nowrap\nset tabstop=4\nautocmd VimEnter * NERDTree\nautocmd VimEnter * wincmd p\nautocmd bufenter * if (winnr(\"$\") == 1 && exists(\"b:NERDTreeType\") && b:NERDTreeType == \"primary\") | q | endif\nhi Directory ctermfg=3 ctermbg=4\nhi comment ctermfg=3 ctermbg=4" | sudo tee .vimrc | |
git clone https://github.com/cakebaker/scss-syntax.vim.git && rm -rf scss-syntax.vim/.git/ && cp -pri scss-syntax.vim/* .vim/ && rm -rf scss-syntax.vim |
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
#!/bin/bash | |
cat /path/to/public_key | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]" |
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
superuser ALL=(ALL) NOPASSWD:ALL |
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
#!/bin/bash | |
rdesktop -g 1920x1080 37.235.172.233 | |
xfreerdp -g 1920x980 -u DL 37.235.172.233 |
OlderNewer