Skip to content

Instantly share code, notes, and snippets.

View h26k2's full-sized avatar

Hasnain Karim h26k2

  • DoLocal Limited - Multi Award Winning Digital Marketing Agency in Liverpool
  • Karachi, Pakistan
  • LinkedIn in/hasnainkarim262
View GitHub Profile
@h26k2
h26k2 / smtpDemonstration.cs
Created May 23, 2018 12:05
Just a demonstration of Sending emails in c# using Smtp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//These Two namespaces are required for SMTP
using System.Net;
using System.Net.Mail;
@h26k2
h26k2 / dropdown.html
Created July 4, 2018 06:41
simple demonstration of dropdown using js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Dropdown Practice</title>
<style>
@h26k2
h26k2 / multiple_value_dictionary.cs
Created September 24, 2018 18:12 — forked from ishu3101/multiple_value_dictionary.cs
Dictionary with Single Key and Multiple Values Example in C#. See https://repl.it/CY3S/1 to run example code online.
using System;
using System.Collections.Generic;
class MainClass {
public static void Main (string[] args) {
Dictionary<string, List<String>> map = new Dictionary<string, List<String>>();
// create list one and store values
List<string> valSetOne = new List<string>();
@h26k2
h26k2 / forEach-prc.js
Created March 24, 2019 17:54
Using foreach loop on html elements in js
Array.prototype.forEach.call(btns,(btn)=>{
alert("button");
})
//Just a short code for opening materialize css datepicker.. in react
M.Datepicker.getInstance(document.querySelector('.datepicker')).open();
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@h26k2
h26k2 / show-image.js
Created July 22, 2019 12:32
Displays a picture LOCALLY when user uploads
/**************************************************************
* Displaying Picture when user uploads it (from the localhost)
***************************************************************/
let tempProfilePicContainer = document.getElementById("reg--profile--pic");
let reader = new FileReader();
function showImage(that){
const objLen = Object.entries(displayFields).length;
console.log(objLen);
@h26k2
h26k2 / query-fetch.js
Created August 3, 2019 09:06
simple demonstration of using extracting query parameters from url in react.js
// import queryString from 'query-string'
const queryParams = queryString.parse(props.location.search);
let selectCourse , selectService , msgValue;
selectCourse = selectService = false;
if(queryParams['course'] !== undefined){
selectCourse = true;
}
@h26k2
h26k2 / pro-redirects-react.js
Created August 4, 2019 12:05
programmatically redirects REACT
// for redirect to a page
this.props.history.push({
pathname : '/signin'
})
//for redirect to a page with query parameters
this.prosp.history.push({
pathname: '/events',