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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListAllMyBuckets" | |
], | |
"Resource": [ | |
"arn:aws:s3:::my-bucket" |
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/sh | |
# Creates swap file | |
sudo dd if=/dev/zero of=/swapfile bs=1G count=1 && | |
sudo chmod 600 /swapfile && | |
sudo mkswap /swapfile && | |
sudo swapon /swapfile; | |
# Remove swap file | |
sudo swapoff /swapfile && |
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 | |
namespace Vendor\MyLoginBundle\Services; | |
use Symfony\Component\HttpFoundation\RequestStack, | |
Symfony\Component\HttpFoundation\Response, | |
Symfony\Component\HttpFoundation\Cookie; | |
class LoginService | |
{ |
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 | |
# Tweaks for macOS | |
# Disable ruber band bouncing scrolling | |
sudo defaults write -g NSScrollViewRubberbanding -int 0 | |
# Disable all animations | |
sudo defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false | |
# Enable press and hold key to repeat |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Redirect to WWW all domain variants but wwww variant | |
# Redirect all domains that include the keywords target-domain, redirect-domain1, redirect-domain2 | |
# Excluding www.target-domain.com, www.no-redirect-domain1.com and www.no-redirect-domain2.com | |
# To www.target-domain.com | |
RewriteCond %{HTTP_HOST} ^(?!www\.target-domain\.com|.*\.no-redirect-domain1\.com)(.*\.|)(target-domain|redirect-domain1|redirect-domain2)\..*$ [NC] | |
RewriteRule ^(.*)$ http://www.target-domain.com$1 [R=301,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
#cloud-config | |
apt_upgrade: false | |
preserve_hostname: true | |
runcmd: | |
- hostname "Hostname-`ec2metadata --instance-id`" | |
- echo "127.0.0.1 Hostname-`ec2metadata --instance-id`" >> /etc/hosts | |
- echo "Hostname-`ec2metadata --instance-id`" > /etc/hostname |
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/sh | |
# Delete last commit already pushed to a remote repository | |
git reset HEAD^ --hard; | |
git push origin -f; | |
# Change remote URL | |
git remote set-url origin <repo_url> | |
# Revert local changes to move back to the origin is |
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
# Create a CSV with query results and save it to a file | |
SELECT * FROM table INTO OUTFILE '/var/lib/mysql-files/table.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ',' ESCAPED BY '"' LINES TERMINATED BY '\r\n'; | |
# Get selected fields and include a related field from other table | |
SELECT tableA.filed1, tableA.field2, tableB.filed1, tableB.field2 FROM tableA INNER JOIN tableB ON tableA.id = tableB.id; | |
# Filter fields with wildcard and order by a cetain field | |
SELECT * FROM table WHERE field1 LIKE '%@example.com' ORDER BY field2 | |
# Find unique duplicated records of a certain field |
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 hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Lighter.tmTheme", | |
"font_options": | |
[ | |
"gray_antialias", | |
"subpixel_antialias", | |
"bold", | |
"no_round" |
OlderNewer