Skip to content

Instantly share code, notes, and snippets.

View santoshshinde2012's full-sized avatar
🏠
Working from home

Santosh Shinde santoshshinde2012

🏠
Working from home
View GitHub Profile
@santoshshinde2012
santoshshinde2012 / angularsnippet
Created September 24, 2017 09:00
The difference between services and factories
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
};
});
//factory style, more involved but more sophisticated
@santoshshinde2012
santoshshinde2012 / async-example.js
Created February 12, 2018 06:37
Callback vs Promise and Async/Await
// Callback - Example:
// function to alert user name
var greeting = (name) => { alert('Hello ' + name); };
// function to process user input
var processUserInput = (callback) => { var name = prompt('Please enter your name.'); callback(name); };
@santoshshinde2012
santoshshinde2012 / onblur.jsx
Created February 23, 2018 17:28
onBlur for entire react component
var HelloMessage = React.createClass({
render: function() {
return <div tabIndex="1" onBlur={this.onBlur}>
Hello <input type="text" value="wat"/>
</div>;
},
onBlur: function(e) {
var currentTarget = e.currentTarget;
@santoshshinde2012
santoshshinde2012 / MySQL_macOS_Sierra.md
Created March 14, 2018 08:28 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@santoshshinde2012
santoshshinde2012 / MySQL_macOS_Sierra.md
Created March 14, 2018 08:28 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@santoshshinde2012
santoshshinde2012 / Build Ionic 2 Cordova Apps For Specific Platform Version (config.xml)
Last active October 8, 2019 14:36
Build Ionic 2 Cordova Apps For Specific Platform Version (config.xml)
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
@santoshshinde2012
santoshshinde2012 / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 9, 2020 11:17 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@santoshshinde2012
santoshshinde2012 / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 9, 2020 11:17 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@santoshshinde2012
santoshshinde2012 / open-source-sso.md
Created March 15, 2021 06:36 — forked from bmaupin/open-source-sso.md
Comparison of open-source SSO implementations
@santoshshinde2012
santoshshinde2012 / System Design.md
Created May 10, 2021 05:56 — 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?