Function | Shortcut |
---|---|
Previous Tab | ⌘ + Left Arrow |
Next Tab | ⌘ + Right Arrow |
Go to Tab | ⌘ + Number |
Go to Window | ⌘ + Option + Number |
Go to Split Pane by Direction | ⌘ + Option + Arrow |
Go to Split Pane by Order of Use | ⌘ + ] , ⌘ + [ |
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
<script> | |
window.addEventListener('devicelight', function(e) { | |
var lux = e.value; | |
if (lux < 50) { // luz tenue | |
document.body.className = 'tenue'; | |
} | |
if (lux >= 50 && lux <= 1500) { //luz normal | |
document.body.className = 'normal'; | |
} |
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 | |
# this script makes a database backup and delete files older than 15 days | |
# to make script execuable use 'chmod +x backupdb.sh' | |
# change username, password and database for yours and modify your path if needed | |
mysqldump -u [username] -p[password] [database_name] > /root/backups/db_backup_`date +"%Y%m%d%H%M%S"`.sql | |
# change '-mtime +15' to keep more or less days (and path if needed) | |
find /root/backups/* -mtime +15 -exec rm {} \; |
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
# Tested on Magento CE 1.4.1.1 - 1.9.2.4 | |
SET FOREIGN_KEY_CHECKS=0; | |
############################## | |
# SALES RELATED TABLES | |
############################## | |
TRUNCATE `db5j_sales_flat_creditmemo`; | |
TRUNCATE `db5j_sales_flat_creditmemo_comment`; | |
TRUNCATE `db5j_sales_flat_creditmemo_grid`; |
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 | |
# Configure homebrew permissions to allow multiple users on MAC OSX. | |
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine. | |
# allow admins to manage homebrew's local install directory | |
chgrp -R admin /usr/local | |
chmod -R g+w /usr/local | |
# allow admins to homebrew's local cache of formulae and source files | |
chgrp -R admin /Library/Caches/Homebrew |
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 | |
/** | |
* It's just a sample helper | |
* I'm sure it can be done better... | |
**/ | |
class QueueHelper | |
{ | |
static public function check(){ | |
$out = []; |
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
function doSomething() { | |
console.log('do something with jQuery'); | |
} | |
var waitInterval = window.setInterval(function () { | |
try { | |
if (jQuery === 'function') { | |
clearInterval(waitInterval); | |
doSomething(); | |
} |
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 our previous code should be here | |
// this array is used for identification of allowed origins in CORS | |
const originWhitelist = ['http://localhost:3000', 'https://example.net']; | |
// middleware route that all requests pass through | |
router.use((request, response, next) => { | |
console.log('Server info: Request received'); | |
let origin = request.headers.origin; |
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
self.addEventListener('install', (e) => { | |
e.waitUntil( | |
caches.open("precache").then((cache) => cache.add("/broken.png")) | |
); | |
}); | |
function isImage(fetchRequest) { | |
return fetchRequest.method === "GET" && fetchRequest.destination === "image"; | |
} |
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
https://github.com/phpstan/phpstan | |
https://github.com/phpstan/phpstan-strict-rules | |
https://github.com/rectorphp/rector | |
https://github.com/phpDocumentor/phpDocumentor2 | |
https://github.com/FriendsOfPHP/PHP-CS-Fixer | |
https://github.com/karlosagudo/fixtro | |
https://github.com/vimeo/psalm | |
https://github.com/phpmetrics/phpmetrics |