Skip to content

Instantly share code, notes, and snippets.

View GideonBabu's full-sized avatar
💭
Looking for a challenging opportunity

Gideon Babu GideonBabu

💭
Looking for a challenging opportunity
View GitHub Profile
@GideonBabu
GideonBabu / System Design.md
Created June 27, 2020 09:45 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@GideonBabu
GideonBabu / javascript_naming_convention.txt
Created January 30, 2020 12:48
JavaScript Best Practices and Naming convention
JavaScript variable naming:
1. Names can contain letters, digits, underscores, and dollar signs.
2. Names must begin with a letter
3. Names can also begin with $ and _ (but we will not use it in this tutorial)
4. Names are case sensitive (y and Y are different variables)
5. Reserved words (like JavaScript keywords) cannot be used as names
@GideonBabu
GideonBabu / svn_useful_commands.txt
Created January 22, 2020 10:27
SVN useful commands
// to revert a file
svn revert filename
// to revert all the files inside folder named [htdocs]
// http://svnbook.red-bean.com/en/1.8/svn.ref.svn.c.revert.html
cd htdocs
svn revert -R .
@GideonBabu
GideonBabu / Phpstorm_tips.txt
Last active January 30, 2020 12:56
PhpStorm tips
You can compare two table structures and see the differences in columns, keys, indexes, and other structural table elements. In the Database tool window (View | Tool Windows | Database), select two tables. Right-click the selection and navigate to Compare Ctrl+D.
To compare contents of two tables, right-click two tables and navigate to Compare Content.
+++
You can add a brief description of any breakpoint to ease search in future.
Press Ctrl+Shift+8 to view all existing breakpoints, then right-click the breakpoint you want to provide a description for, and choose Edit description
+++

[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
$ End of line
\A Start of string
\z End of string
. Any single character
\s Any whitespace character

@GideonBabu
GideonBabu / GestureCallback Helper Class - Mobile Webkit
Created November 26, 2019 16:35 — forked from ashishpuliyel/GestureCallback Helper Class - Mobile Webkit
Class to handle touch gestures for scale and rotate (pinch to zoom) on Mobile webkit
/*
This is from
http://uihacker.blogspot.com/2011/04/javascript-handle-touch-gestures-for.html
I wrote a little class to handle pinch & rotate gestures on a web page in iOS. There's a bunch of event listener adding/removing, which can get a little messy, so this should help keep your code clean if you need to handle gestures.
Here's the class:
*/
function GestureCallback( element, endCallback, changeCallback ) {
@GideonBabu
GideonBabu / javascript_code_snippets_for_day_today_work.js
Last active January 28, 2020 08:50
Useful JavaScript (JS) or jQuery snippets for day-to-day Software Development
// detect the Enter key in a text input field
$(".input1").on('keyup', function (e) {
if (e.keyCode === 13) {
// Do something
}
});
// array for..of cycle
// tip: you can stop iterating at any time using a break statement.
@GideonBabu
GideonBabu / iphone_disable_autozoom_input.css
Created November 21, 2019 13:07 — forked from vedranjaic/iphone_disable_autozoom_input.css
css: iPhone - Disable auto-zoom on input fields
/*
* disable auto-zoom on iphone input field focus
* http://www.456bereastreet.com/archive/201212/ios_webkit_browsers_and_auto-zooming_form_controls/
*/
input[type='text']:focus,
input[type='number']:focus,
textarea:focus {
font-size: 16px;
}
@GideonBabu
GideonBabu / PHP-7-New-Features.txt
Last active February 21, 2019 07:34
PHP 7 features and brief notes
Better performance - PHP 7 is twice as fast as PHP 5.6. Optimization
Scalar type declarations - pass function params with variable type
function sum (int $a, int $b){
}
Return type declarations - mention the return variable type of a function
function sum ($a, $b): int{