Skip to content

Instantly share code, notes, and snippets.

View lalitmee's full-sized avatar
👨‍💻
Unmarshalling

Lalit Kumar lalitmee

👨‍💻
Unmarshalling
View GitHub Profile
@lalitmee
lalitmee / home.service.ts
Created September 28, 2018 07:11
Home service
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { MessageService } from 'primeng/api';
import 'rxjs/add/operator/map';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { environment } from '../../environments/environment';
@Injectable()
export class HomeService {
@lalitmee
lalitmee / removeDuplicates.js
Created September 14, 2018 12:30
Function for removing the Duplicated and sorting the array
removeDuplicates(myArr, prop) {
const noResult = {
label: 'No Result Found',
value: null
};
if (this.data && this.data.length > 0 && myArr && myArr.length === 0) {
myArr.push(noResult);
return myArr;
} else {
myArr.sort((a, b) => {
[
{
"keys": ["ctrl+."],
"command": "js_prettier"
},
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
@lalitmee
lalitmee / Ubuntu_Commands.md
Created August 31, 2018 18:43
Useful Commands

Remove unused ppa repositories from ubuntu

root@linuxhelp:~# add-apt-repository --remove ppa:cairo-dock-team/weekly
@lalitmee
lalitmee / ulauncherLogs.md
Created August 31, 2018 15:23
Ulauncher logs from Lubuntu 18.04
 lalit  ~/Downloads  ulauncher -v

(ulauncher:4032): dbind-WARNING **: 20:52:09.574: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
/usr/lib/python2.7/dist-packages/ulauncher/util/desktop/notification.py:1: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
  from gi.repository import Notify
/usr/lib/python2.7/dist-packages/ulauncher/ui/windows/PreferencesUlauncherDialog.py:6: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gio, Gtk, WebKit2, GLib
2018-08-31 20:52:09,638 | INFO | ulauncher: main() | Ulauncher version 4.1.0.r1
2018-08-31 20:52:09,639 | INFO | ulauncher: main() | GTK+ 3.22.30
@lalitmee
lalitmee / listfilter.py
Last active August 25, 2018 15:56
Python best Practices and clever Solutions
''' For example,
filter_list([1,2,'aasf','1','123',123]) == [1,2,123]
'''
def filter_list(l):
'return a new list with the strings filtered out'
return [i for i in l if not isinstance(i, str)]
let offering = offeringValue;
let newOffering = newOfferingValue;
offering = offeringValue.split(" ").join("-");
newOffering = newOfferingValue.split(" ").join("-");
const { match } = this.props;
// console.log(this.props);
// calling the function to send the data to parent
// for cityId and localityArray
debugger;
if (this.state.newOfferingRedirect && noOffer == false) {
import React from "react";
import { PropTypes } from "prop-types";
import { withRouter } from "react-router-dom";
import { connect } from "react-redux";
import { Segment } from "semantic-ui-react";
import "semantic-ui-css/semantic.min.css";
import image from "../../../../img/dashboard.png";
import paragraph from "../../../../img/paragraph.png";
import React from "react";
import { PropTypes } from "prop-types";
import { Link, matchPath } from "react-router-dom";
import { connect } from "react-redux";
import { Segment } from "semantic-ui-react";
import "semantic-ui-css/semantic.min.css";
import image from "../../../../img/dashboard.png";
import paragraph from "../../../../img/paragraph.png";
import React from "react";
import { Link } from "react-router-dom";
import { connect } from "react-redux";
import { Container, Menu, Button } from "semantic-ui-react";
import "semantic-ui-css/semantic.min.css";
import Breadcrumbs from "react-router-dynamic-breadcrumbs";
import HomePageHeader from "../Headers/HomePageHeader";
import MainFooter from "../Footers/MainFooter";
import DealPackageView from "./DealPackageView";