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 / 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;
@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;

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 / 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))
@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
---
- name: First Playbook for CodeIn
hosts: codein_fedora_boxes
tasks:
- name: Display
debug:
msg: "My Name is Nasir Hussain, It's First Ansible task and It's awesome"
#Remember to add codein_fedora_boxes or any type of host on your ansible hosts file located : /etc/ansible/hosts use nano to edit
---
- name: Installing Jenkins by Ansible automation
hosts: localhost
tasks:
- name: Installing Java 8
yum:
name: "java-1.8.0-openjdk"
state: present
become: true
- name: Correcting the Alternative to Change Default Java
---
- name: Installing Jenkins by Ansible automation
hosts: codein_fedora_boxes
tasks:
- name: Downloading Jenkins from yum repo
get_url:
url: "https://pkg.jenkins.io/redhat-stable/jenkins.repo"
dest: /etc/yum.repos.d/jenkins.repo
become: true
@nasirhm
nasirhm / gist:1dd2ad31e585b350b7a82b6c36a67cec
Created March 17, 2020 13:11
CloudFunctionDialogflowError
async function someFunction(agent) {
try {
let result_a;
let result_b = [];
let param1 = agent.parameters.from; // From Dialgflow
let param2 = agent.parameters.to; //From Dialogflow
let param3 = agent.parameters.on; // From Dialogflow
let myBody = {
`var currentTime = new Date().getTime();
while(currentTime + 4500 >= new Date().getTime()){
agent.add(new Card({All Params}))
}
agent.setFollowupEvent('Delay1')
agent.add("Now Working")`