Skip to content

Instantly share code, notes, and snippets.

View oshanz's full-sized avatar
🌴
On vacation

Oshan Wisumperuma oshanz

🌴
On vacation
View GitHub Profile
@oshanz
oshanz / checkConstraints
Created February 11, 2016 06:08
checkConstraints
protected function checkConstraints($entity, $key)
{
$query = "SELECT TABLE_NAME, COLUMN_NAME
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE REFERENCED_TABLE_SCHEMA = :schema
AND REFERENCED_TABLE_NAME = :table
AND REFERENCED_COLUMN_NAME = :column";
$stmt = $this->em->getConnection()->prepare($query);
$stmt->bindValue('schema', $this->em->getConnection()->getDatabase());
$stmt->bindValue('table', $this->em->getMetadataFactory()->getMetadataFor($entity)->table['name']);
@oshanz
oshanz / KPIs for Web application - You can't manage whay you can't measure.
Last active July 19, 2018 10:39
KPIs for Web application - You can't manage whay you can't measure.
1. User Satisfaction/Apdex Score
2. averages suck but people like it
3. Error Rate
HTTP Error % – Number of web requests that ended in an error.
Logged Exceptions – Number of unhandled and logged errors from your application.
Thrown Exceptions – Number of all exceptions that have been thrown.
4. scale matrix (instanses)
5. request rate, number of concurrent users
6. server,application cpu
7. Application Availability
@oshanz
oshanz / Conceptual Blockbusting
Last active July 14, 2018 18:20
rock the career
Perceptual blocks
Detecting what you expect – stereotyping
Difficulty in isolating the problem
Tendency to delimit the problem area poorly
Inability to see the problem from various viewpoints
Saturation
Failure to utilize all sensory inputs
Emotional Blocks
Emotion
Freud
@oshanz
oshanz / define your team
Last active July 23, 2018 05:43
define your team
Marcus Buckingham & Curt Coffman – First, Break All The Rules
* The Measuring Stick – Gallup Study
Do I know what is expected of me at work?
Do I have the materials and equipment I need to do my work right?
At work, do I have the opportunity to do what I do best every day?
In the last seven days, have I received recognition or praise for doing good work?
Does my supervisor, or someone at work, seem to care about me as a person?
Is there someone at work who encourages my development?
@oshanz
oshanz / Facts and Fallacies of Software Engineering
Last active July 19, 2018 10:38
Facts and Fallacies of Software Engineering
* Most of our estimates are more like wishes than realistic targets.
* There is almost always a price to be paid for working toward an unrealistic deadline. That price is most often paid in human terms (reputation, morale, and health, among others), but - as you can see in this story - there is likely a financial price to be paid as well.
* Screwed together components would be a wonderful way to build software. So would automatic generation of code from a requirements specification. And neither of those, in my view, is ever likely to happen in any meaningful way.
* Someone building a reusable component is thinking of a particular problem to be solved and trying to determine whether there is some more general problem analogous to this specific one.
* Reusable component needs to be generalized: it is not enough to show that it solves your problem at hand. It must solve some related problems, problems that may not have been so clearly in mind when the component was being developed.
* The most important factor
@oshanz
oshanz / The 21 Irrefutable Laws of Leadership
Last active May 3, 2020 17:10
The 21 Irrefutable Laws of Leadership
1. The Law of the Lid: Leadership Ability Determines a Person’s Level of Effectiveness
2. The Law of Influence: The True Measure of Leadership Is Influence – Nothing More, Nothing Less
3. The Law of Process: Leadership Develops Daily, Not in a Day
4. The Law of Navigation: Anyone Can Steer the Ship, But It Takes a Leader to Chart the Course
5. The Law of E.F. Hutton: When the Real Leader Speaks, People Listen
6. The Law of Solid Ground: Trust Is the Foundation of Leadership
7. The Law of Respect: People Naturally Follow Leaders Stronger Than Themselves
8. The Law of Intuition: Leaders Evaluate Everything with a Leadership Bias
9. The Law of Magnetism: Who You Are Is Who You Attract
10. The Law of Connection: Leaders Touch a Heart Before They Ask for a Hand
@oshanz
oshanz / Cost
Last active July 19, 2018 10:31
Aws notes
• Cost Explorer – See patterns in AWS spend over time, project future costs, identify areas that need further inquiry, observe Reserved Instance utilization, observe Reserved Instance coverage, and receive Reserved Instance recommendations.
• AWS Trusted Advisor – Get real-time identification of potential areas for optimization.
• AWS Budgets – Set custom budgets that trigger alerts when cost or usage exceed (or are forecasted to exceed) a budgeted amount. Budgets can be set based on tags and accounts as well as resource types.
• Amazon CloudWatch – Collect and track metrics, monitor log files, set alarms, and automatically react to changes in AWS resources.
• AWS CloudTrail – Log, continuously monitor, and retain account activity related to actions across AWS infrastructure at low cost.
• Amazon S3 Analytics – Automated analysis and visualization of Amazon S3 storage patterns to help you decide when to shift data to a different storage class.
• Cost Optimization Monitor – Automatically proc
@oshanz
oshanz / leading with questions
Last active July 19, 2018 10:56
leading with questions
Open-ended Questions
• Clarifying: improving the clarity of a message or statement; encouraging more elaboration – “How exactly would you like this done?”
• Reflective: challenging basic assumptions – “Why do we always do it this way?” “Has this ever been tried?”
• Probing: Getting more details; going deeper – “Can you elaborate on why this is happening?”
• Creating connections: asking for systems perspectives – “What will be the consequences of this action?”
• Exploratory: opening up new avenues and insights that lead to new explorations – “Have you considered such a source?”
• Analytical: examining cause and effect, not just symptoms – “Why has this happened?”
• Affective: encouraging sharing of feelings – “How do you feel/how excited are you about this strategy?
@oshanz
oshanz / who am i
Created July 23, 2018 14:00
who am i
string theory
https://www.youtube.com/watch?v=RZ5dj-Ozwm0
Consciousness
https://www.youtube.com/watch?v=iONlo9WcKgQ
https://www.youtube.com/watch?v=rHKwIYsPXLg
@oshanz
oshanz / vim
Last active July 26, 2018 11:41
vim
https://vimawesome.com/plugin/nerdtree-red
https://vimawesome.com/plugin/vim-airline-superman
https://vimawesome.com/plugin/youcompleteme
https://vimawesome.com/plugin/tagbar
https://vimawesome.com/plugin/vim-ruby
https://vimawesome.com/plugin/endwise-vim
https://github.com/deepredsky/vim-rubocop
https://vimawesome.com/plugin/ctrlp-vim-everything-has-changed
https://vimawesome.com/plugin/vim-polyglot
https://vimawesome.com/plugin/onedark-vim