Skip to content

Instantly share code, notes, and snippets.

View zaagan's full-sized avatar
🤘
Hey !! Have a nice day

Ozesh Thapa zaagan

🤘
Hey !! Have a nice day
View GitHub Profile
@zaagan
zaagan / Parsing Li.cs
Last active November 28, 2017 08:39
[Html Parsing] Html Agility Pack #CSharp #HtmlParsing
// Source : https://stackoverflow.com/questions/881425/html-agility-pack-parsing-li
List<string> lstLiInnerTexts = new List<string>();
foreach (HtmlNode li in doc.DocumentNode.SelectNodes("//li")) {
lstLiInnerTexts.Add(li.InnerText);
}
@zaagan
zaagan / Emphasis.md
Last active January 2, 2018 07:13
Sources to Learn Writing Markdowns #markdown #github

Emphasis

This text will be italic This will also be italic

This text will be bold This will also be bold

You can combine them

@zaagan
zaagan / EditEnvironmentVariable
Last active March 1, 2018 05:46
Batch scripts and snippets #bat #batchscripting
#Edit Environment Variable, Windows
rundll32.exe sysdm.cpl,EditEnvironmentVariables
@zaagan
zaagan / ApplicationPath.cs
Last active January 5, 2019 13:02
C# Code Snippets
//Full Path till the executable, In case of shadow copies, this will be the temp directory
System.Reflection.Assembly.GetExecutingAssembly().Location;
//Permanent path of the assembly
System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
//Local Codebase Path
new Uri(System.IO.Path.GetDirectoryName(codeBase)).LocalPath;
//Full Path till the directory
@zaagan
zaagan / Basic Material UI Component
Last active January 15, 2019 07:01
ReactJS Code snippets #react #routes #gitignore #snippets #reactjs
import React, { Component } from "react";
import PropTypes from "prop-types";
import { withRouter } from "react-router";
import { withStyles } from "@material-ui/core/styles";
import compose from "recompose/compose";
import { connect } from "react-redux";
import Typography from "@material-ui/core/Typography";
const styles = theme => ({});
# List all Network Connections
wmic nic get name,macaddress
NetSh Interface httpstunnel Show Interfaces
NetSh Interface IPv4 Show Interfaces
NetSh Interface IPv6 Show Interfaces
reg add HKLM SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0001] /v NetworkAddress /d 0123456789AB
@zaagan
zaagan / Change Directory
Last active February 10, 2019 07:54
Basic bash scripting
@echo off
Rem The cd without any parameters is used to display the current working directory
cd
Rem Changing the path to Program Files
cd\Program Files
cd
Rem Changing the path to Program Files
@zaagan
zaagan / System Design.md
Created February 10, 2019 08:26 — 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?
import React, { Component } from "react";
import { Header } from "react-native-elements";
import EStyleSheet from 'react-native-extended-stylesheet';
import {Platform} from 'react-native';
class AppBarNE extends Component {
constructor(props) {
super(props);
this.state = {
@zaagan
zaagan / Array
Last active May 2, 2019 18:21
Javascript handy snippets
//https://stackoverflow.com/questions/1988349/array-push-if-does-not-exist
// SOURCE: https://stackoverflow.com/a/36683363
// Code Snippet : https://stackoverflow.com/questions/1988349/array-push-if-does-not-exist
var newItem = "OLD_ITEM_1";
var array = ["OLD_ITEM_1", "OLD_ITEM_2"];
array.indexOf(newItem) === -1 ?