- command + option + J, context: html, result: suround with template
- command + shift + return, context: statement or var declaration, result: add semi colon
- command + return, context: in fragment context, result: run the fragment, convenient when your database is configured to work with the IDE, command + return will execute the sql query
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
describe('controllerCtrl', function () { | |
var $controller, | |
$rootScope, | |
$scope; | |
beforeEach(module('controller')); | |
beforeEach(inject(function ($injector) { | |
$controller = $injector.get('$controller'); | |
$rootScope = $injector.get('$rootScope'); |
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
describe('Forms module', function () { | |
var services; | |
beforeEach(module('app', function(getHtmlProvider){ | |
// set service as the provider to be able to access the setters | |
services = getHtmlProvider; | |
})); | |
// can still test the service by injecting it |
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
var warn = true; | |
window.onbeforeunload = function(e){ | |
e = e || window.event; | |
if(warn){ | |
e.returnMessage = 'yop'; | |
setTimeout(function(){ | |
warn = false; | |
location.href='http://google.fr'; | |
}, 1); | |
return 'Are you sure? I got a secret to show you before!'; |
Whenever you're using alias tasks, you can't pass a flag to aliased tasks. Here are a few patterns to deal with that.
For a global setting available to all tasks, use options:
grunt.registerTask('upload', 'Upload code to deploy', function(n) {
var target = grunt.option('target');
// use target var to do something useful
});
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
- CTRL+D, **Select a word and all its occurrence** | |
- CTRL+SHIFT+D, **Copy paste the current line** | |
- CTRL+M, **Move the caret to the closest bracket or curly bracket** | |
- CTRL+SHIFT+M, **Select content into the the closest bracket or curly bracket** | |
- CTRL+L, **Select the current line** | |
- CTRL+SHIFT+L, **add a caret at the end of each line selected** | |
- CTRL+K+K, **Delete all the content on the right of the caret** | |
- CTRL+SHIFT+K, **Delete the current line** | |
- CTRL+W, **close the current tab** | |
- CTRL+SHIFT+G, **Wrap content with a tag, can use zen coding** |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
UPDATE `wp_posts` SET `guid` = REPLACE( `guid` , 'localhost', 'liveserver' ) |
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 if(is_front_page()): ?> | |
// do not use prefecth on homepage | |
<?php elseif (is_singular()): ?> | |
// load the next post, view http://ideasandpixels.com/get-only-url-of-next-and-previous-posts-wordpress | |
<link rel="prefetch" href="<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>"> | |
<link rel="prerender" href="<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>"> | |
<?php else: ?> | |
<link rel="prefetch" href="<?php echo home_url(); ?>"> | |
<link rel="prerender" href="<?php echo home_url(); ?>"> | |
<?php endif; ?> |
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
Accounts.loginServiceConfiguration.remove({service: "github"}); | |
Accounts.loginServiceConfiguration.remove({service: "facebook"}); | |
Accounts.loginServiceConfiguration.remove({service: "twitter"}); | |
Accounts.loginServiceConfiguration.remove({service: "linkedin"}); | |
Accounts.loginServiceConfiguration.insert({ | |
service: "github", | |
clientId: "ID", | |
secret: "SECRET" | |
}); |