Skip to content

Instantly share code, notes, and snippets.

View nasirhm's full-sized avatar
😀
404 Not Found

Nasir Hussain nasirhm

😀
404 Not Found
View GitHub Profile
@nasirhm
nasirhm / modern_js.md
Created February 11, 2019 17:29 — forked from gaearon/modern_js.md
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@nasirhm
nasirhm / simpleScraper.js
Created February 1, 2019 14:27
Medium Article about Web Scraping
const rp = require('request-promise');
const cheer = require('cheerio');
const url = 'https://en.wikipedia.org/wiki/List_of_Presidents_of_the_United_States';
rp(url)
.then(function(data){
//Filtering Tags - Length one is to check there isn't additional Data Coming
console.log(cheer('big > a',data.length));
console.log(cheer('big > a',data))

Q.1

The speed limit of Shahrah-e-Faisal is 60 km/hr. Write a program that, given a car's speed, tells whether it is Overspeeding or not.


Q.2

Your task is to develop a mini-facebook. If the user is logged in, it should print Welcome, <user's name>, otherwise it should print Please log in to continue!


@nasirhm
nasirhm / TToken.sol
Created June 2, 2018 19:39
TILT TOken ERC20
pragma solidity ^0.4.11;
import './IERC20.sol';
import './SafeMath.sol';
contract TToken is IERC20{
using SafeMath for uint256;
uint public constant _totalSupply = 0;
string public constant symbol = "TTO";
string public constant name = "Tilt TOKEN";
uint8 public constant decimals = 18;
uint256 public constant RATE = 500;
@nasirhm
nasirhm / SToken.sol
Created May 28, 2018 00:28
SOCK Token (STOC) is a ERC20 Token
pragma solidity ^0.4.11;
import './IERC20.sol';
contract SToken is IERC20{
uint public constant _totalSupply = 100000000;
string public constant symbol = "STOC";
string public constant name = "SOCK TOKEN";
uint8 public constant decimals = 3;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;