Skip to content

Instantly share code, notes, and snippets.

@abrarShariar
abrarShariar / hnl.taphover.js
Created February 27, 2016 06:44 — forked from c-kick/hnl.taphover.js
jQuery - Mouse hover on touch devices
//taphover - a solution to the lack of hover on touch devices.
//more info: http://www.hnldesign.nl/work/code/mouseover-hover-on-touch-devices-using-jquery/
$('a.taphover').on('touchstart', function (e) {
'use strict'; //satisfy the code inspectors
var link = $(this); //preselect the link
if (link.hasClass('hover')) {
return true;
} else {
link.addClass('hover');
$('a.taphover').not(this).removeClass('hover');
@abrarShariar
abrarShariar / prompt_cal.js
Created February 28, 2016 11:03
taking input in a prompt window and calculate output
function pushCalc(){
var in1=parseInt(prompt("Input [1] : "));
var in2=parseInt(prompt("Input [2] : "));
var op=prompt("Choose operator: [+][-][*][/] ");
var res;
switch(op){
case "+":
res=in1+in2;
<html>
<head>
<title>JS</title>
</head>
<body>
<button onclick="swap(this,style)">Swap me</button>
<p id="text1"> C++</p>
<p id="text2">JavaScript</p>
</body>
@abrarShariar
abrarShariar / php-webscraping.md
Created March 3, 2016 13:55 — forked from anchetaWern/php-webscraping.md
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}

@abrarShariar
abrarShariar / cssChange.js
Created March 4, 2016 09:14
just a snippet of changing attributes with JS
var colorArr=["red","blue","black","grey","yellow","pink"];
var fontArr=["sans-serif","monospace","fantasy"];
// var marginArr=["120%","100%","100%","120%"];
var btn=document.getElementById("btn"); //your button id
var text=document.getElementById("text"); //your text id
var countColor=0,countFont=0,countMargin=0;
btn.onclick=function(){
if(countColor<colorArr.length){ //change color
@abrarShariar
abrarShariar / loadFun.html
Created March 4, 2016 16:35
Loading status fun with JS
<style type="text/css">
#mainBox{
border-style: groove;
margin-right: 46.5%;
}
</style>
<body>
<h3 id="head">Loading JS... </h3>
@abrarShariar
abrarShariar / colorMyName.html
Created March 4, 2016 18:11
fun with setTimeout() in JS
<html>
<head>
<title>JS</title>
</head>
<body>
<div id="box">
</div>
<script type="text/javascript">
@abrarShariar
abrarShariar / ajax_01.html
Created March 10, 2016 07:53
Ajax load() with jquery
<script src="https://code.jquery.com/jquery-2.2.1.min.js"></script>
<input type="button" id="active" value="AJAX ME..">
<div id="info">
<!-- display ajax data here -->
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#active").click(function(){
@abrarShariar
abrarShariar / conversion_loop.asm
Created March 10, 2016 16:43
conversion between lower and upper case letters (vice versa)
.model small
.stack 100h
.data
letter db ?
err db 'INVALID INPUT$'
.code
main proc
@abrarShariar
abrarShariar / case_convert.asm
Last active March 11, 2016 18:00
Lowercase to uppercase (vice versa) using logical OR, XOR
.model small
.stack 100h
.data
lower db 'Lower: $'
upper db 'Upper: $'
inval db 'INVALID INPUT $'
.code