Skip to content

Instantly share code, notes, and snippets.

View Mukesh23singh's full-sized avatar

Mukesh Singh Mukesh23singh

  • Citiustech healthcare technology private limited
  • Mumbai
View GitHub Profile
@Mukesh23singh
Mukesh23singh / Search my gists.md
Created April 25, 2020 12:06 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@Mukesh23singh
Mukesh23singh / gql_search_stargazers.gql
Created April 21, 2020 19:40 — forked from katopz/gql_search_stargazers.gql
GraphQL Github Example : Search for top ten stargazers
// Try at : https://graphql-explorer.githubapp.com/
{
search(query: "language:JavaScript stars:>10000", type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
name
descriptionHTML
stargazers {
@Mukesh23singh
Mukesh23singh / helper.js
Created November 15, 2019 08:51
helper.js
/**
* Copyright 2017 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/**
* Copyright 2018 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Mukesh23singh
Mukesh23singh / regexCheatsheet.js
Created January 15, 2019 05:54 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
function orderedByRanking(people) {
return objs.sort(compare);
}
function compare(a,b) {
if (a.ranking < b.ranking )
return -1;
if (a.ranking > b.ranking )
return 1;
return 0;
@Mukesh23singh
Mukesh23singh / 01-controllers-to-components.md
Created March 16, 2018 09:10 — forked from dimitardanailov/01-controllers-to-components.md
Angular 2 and Typescript. Thank you to John Papa for awesome online course: http://www.johnpapa.net/angular-2-first-look

Angular 1

<body ng-controller="StoryController as vm">
  <h3>{{ vm.story.name }}</h3>
  <h3 ng-bind="vm.story.name"></h3>
</body>
@Mukesh23singh
Mukesh23singh / Gemfile
Created February 26, 2018 14:48 — forked from cblunt/Gemfile
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
// note: I'm using redux-actions in here, so the actions might look a bit different than you are used too
// note: This is not complete but the concepts are
// excerpt from app.js
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import fetch from 'isomorphic-fetch'
// note: you could totally leave out the fetch argument here if you set a default (as I do in my actions)
// I'm right now not absolutely sure how I will handle this in the future (the way it is now it is a bit redundant)
@Mukesh23singh
Mukesh23singh / ShowBox.jsx
Created August 6, 2017 14:40 — forked from visualskyrim/ShowBox.jsx
Use Enzyme to test React/Redux container - Code List 1
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { submitValue } from '../store/modules/showBox'
export class ShowBox extends React.Component {
constructor(props) {
super(props)
this.state = {
searchString: this.props.search || ""