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
| https://www.linux.com/community/blogs/133-general-linux/850945-setup-mutt-with-gmail-on-centos-and-ubuntu |
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
| # Setup a service in /etc/init.d | |
| https://www.debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian | |
| # Don't forget the LSB tags | |
| http://help.directadmin.com/item.php?id=379 | |
| # Example on a script called blah: | |
| $ update-rc.d blah defaults |
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
| # /!\ May change whether root or not | |
| netstat -pln [| grep PORT_NB] |
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
| // Array | |
| var list = ['my', 'str', 'list']; | |
| if (~list.indexOf('my')) { | |
| console.log('the `list` array contains \'my\''); | |
| } | |
| if (!~list.indexOf('number')) { | |
| console.log('the `list` array does not contain \'number\''); | |
| } |
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
| $resource(a, b, { | |
| getSomething: { | |
| method: 'GET', | |
| url: baseUrl + ':id' // work if you pass the `id` param in the parameters object | |
| }, | |
| postSomething: { | |
| method: 'POST', | |
| url: baseUrl + ':id', // you need to add the next line to make it work for post requests (didn't try with other verbs) | |
| params: { id: '@id' } | |
| } |
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
| See http://fr.slideshare.net/pirhilton/how-to-name-things-the-hardest-problem-in-programming by @hilton | |
| Summary of naming things badly : | |
| - meaningless: foo | |
| - too general: data | |
| - too short: a | |
| - too long: text_correction_by_editor | |
| - abbreviated: acc (id is the only acceptable abbreviation) | |
| - vague: InvoiceManager | |
| - wrong: order |
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
| // explode -> .split | |
| console.log(['Hello', 'World'].join()) // ',' is optional | |
| // → "Hello,World" | |
| // implode -> .join | |
| console.log('Hello,World'.split(',')) | |
| // → Array [ "Hello", "World" ] |
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
| // We are on page | |
| // http://www.example.com:8080/search?q=devmo#test | |
| console.log(window.location.href) | |
| // → "http://www.example.com:8080/search?q=devmo#test" | |
| console.log(window.location.origin) | |
| // → "http://www.example.com:8080" | |
| console.log(window.location.protocol) |
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
| /** | |
| * console.log | |
| */ | |
| console.log('Hello'); | |
| // → "Hello" | |
| var hello = 'Hello'; | |
| console.log(hello); | |
| // → "Hello" |
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
Show hidden characters
| // Place user-specific overrides in this file, to ensure they're preserved | |
| // when upgrading | |
| { | |
| "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"] | |
| } |