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?
@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 / Useful MySql Commands
Last active November 6, 2019 15:15
Useful MySQL Commands
ALTER TABLE master_activity_log CHANGE `from_user_id` `user_id` INT(11); // change column name
ALTER TABLE master_activity_log DROP log_date; // remove column
ALTER TABLE master_activity_log ADD COLUMN log_datetime DATETIME AFTER after_save; // create new column of existing table
Truncate foreign key constraints table :
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `table name`;
SET FOREIGN_KEY_CHECKS=1;
@GideonBabu
GideonBabu / shell-commands.txt
Last active March 5, 2019 05:49
Useful Shell Commands for Web Development
Compress: tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
Extract: tar -xzvf archive.tar.gz
compress with exclusion of some folders:
tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz .
To find the files using it's name:
find <path> -name "filename-with-extension"
@mutewinter
mutewinter / README.md
Last active December 8, 2021 11:01
Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Touch delay is [a thing of the past][td], but accidental zooming is here to ruin your day. Ever tapped a button quickly on iOS and experienced a zoom instead of two taps? You're in the right place.

Before

Before

@adamdehaven
adamdehaven / element-in-viewport.js
Created April 3, 2017 15:02
jQuery: Check if element is in designated area of viewport (horizontal)
function toggleDecadeVisibility() {
var windowWidth = $(window).width();
$('.element').each(function() {
var elementLeft = $(this).offset().left,
visibleOffset = (windowWidth / 2) - ($(this).width() / 2),
hideOffset = visibleOffset - $(this).width();
// If element is in center of viewport, make visible
if (elementLeft <= visibleOffset && elementLeft >= hideOffset) {
@aboritskiy
aboritskiy / SyncURLsCommand.php
Last active July 1, 2021 15:15
Magento2 EE Cloud tips and tricks
<?php
namespace Sitewards\SyncURLs\Console\Command;
use \Symfony\Component\Console\Command\Command;
use \Symfony\Component\Console\Input\InputInterface;
use \Symfony\Component\Console\Output\OutputInterface;
use \Magento\Framework\App\Config\ConfigResource\ConfigInterface;
use \Magento\Store\Model\StoreManagerInterface;
@josephspurrier
josephspurrier / AwsController.php
Last active February 24, 2019 15:08
Laravel 5.2 Workflow with Service Providers
<?php
// File Location: projectroot/app/Http/Controllers/AwsController.php
namespace App\Http\Controllers;
use \App;
use \AwsS3;
class AwsController extends Controller
@bh-ref
bh-ref / RemoveOptions.php
Last active December 28, 2021 21:06
Remove/Delete Product Attribute Options in Magento 2
<?php
namespace Vendor\ModuleName\Options;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory;
class RemoveOptions
{
@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 20:21
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?