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
// MySQL & MySQL Dump common commands | |
-- Export specific rows from table | |
mysqldump -u user -p dbname --tables myTable --where="id < 1000" | |
-- Dump: one INSERT per row | |
mysqldump --extended-insert=FALSE | |
-- Dump: display columns names | |
mysql dump --complete-insert=TRUE |
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
# Vim: replace ‘),(‘ by ‘),\n(‘ | |
:%s/),(/),\r(/g | |
# Archive content without extraction | |
tar -tf filename.tar.gz | |
# Find a file by its name | |
find . -name "profile.html" | |
# Execute multiple processes |
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
// Best practices: | |
/* | |
1 - Always name anonymous functions. | |
Good: var clickHandler = function clickHandler() { ... } | |
Bad: var clickHandler = function() { ... } | |
Because: | |
- useful for self-reference | |
- debuggable stack trace | |
- self documentating codeYour billing address doesn’t look like it matches up with your current country. Please contact support for assistance or use a payment method registered to your current address. | |
*/ |
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
<?php | |
/* | |
Dependecy Injection (PHP): | |
Dependency Injection is where components are given their dependencies through their constructors, methods, or directly into fields. | |
Usually dependency is done through the constructor but it can also be done by a setter or a (public) property. | |
Source: http://fabien.potencier.org/what-is-dependency-injection.html | |
Example: | |
*/ | |
class User | |
{ |
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
-- Watch assets files | |
php app/console assetic:watch | |
-- Update DB depending on entities | |
php app/console doctrine:schema:update --dump-sql | grep epms | |
-- Update Solr indexes | |
php app/console cron:indexCandidate | |
-- Clear cache |
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
Providers: | |
Registred class, function or value for dependency injection. |
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
'use strict'; | |
/** | |
* Bootstrap-toggle Directive | |
* Forked from from: https://gist.github.com/dave-newson/f6c5e9c2f3bc315e292c | |
* This version supports ngDisabled directive. | |
* Unashamedly coped from https://gist.github.com/jjmontesl/54457bf1342edeb218b7 as it is not available anymore. | |
*/ | |
angular.module('togglecheckbox', []) | |
.directive('toggleCheckbox', function() { |
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
javascript:(function(){ | |
function formatDate(d) { | |
return d.getFullYear() + "-" + ("0"+(d.getMonth()+1)).slice(-2) + "-" + ("0" + d.getDate()).slice(-2); | |
}; | |
var today = new Date(); | |
var aWeekAgo = new Date(new Date().getTime() - 518400000); /* 6 days ago */ | |
location.href = 'https://elmolearning.atlassian.net/plugins/servlet/ac/is.origo.jira.tempo-plugin/tempo-my-work#!/timesheet/?columns=WORKED_COLUMN&dateDisplayType=days&from='+formatDate(aWeekAgo)+'&groupBy=issue&periodKey&periodType=LAST_DAYS&subPeriodType=MONTH&to='+formatDate(today)+'&viewType=TIMESHEET'; | |
})(); |
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 changes of a specific file in history | |
git log -p | |
# See a previous version of a file | |
git show REVISION:path/to/file |