Skip to content

Instantly share code, notes, and snippets.

View iamaamir's full-sized avatar
🏠
Working from home

Aamir khan iamaamir

🏠
Working from home
  • Postman
  • New Delhi
  • 18:43 (UTC +05:30)
  • LinkedIn in/itsaamir
View GitHub Profile
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from os import listdir, chdir, rename
# Valid chars in a file name
alpha = 'abcdefghijklmnopqrstuvwxyz0123456789.'
dir_path = "/home/varun/Desktop/Github Projects/CodeKata/Python"
@iamaamir
iamaamir / VetorsAndList.java
Last active February 3, 2018 23:29
Please write a program to use vector and list to store 10 integers in order (from smallest to largest). You need to find proper location using vector or list functions for each number added. Please do NOT use any sorting function. a. Generate 1 random integer between -100 and 100 and display it on screen b. Insert the number generated in step b …
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Vector;
import java.util.stream.IntStream;
/*Please write a program to use vector and list to store 10 integers in order
(from smallest to largest).
You need to find proper location using vector or list functions for each number added.
@iamaamir
iamaamir / Postfix.java
Last active February 15, 2018 18:15
wap that reads postfix expressions and prints their values. Each input expression should be entered on its own line, and the program should terminate when the user enters a blank line. Please do error checking for any error.
import java.util.EmptyStackException;
import java.util.Scanner;
import java.util.Stack;
/*
wap that reads postfix expressions and prints their values.
Each input expression should be entered on its own line,
and the program should terminate when the user enters a blank line.
Please do error checking for any error.
import java.util.Scanner;
public class DecimalToBinary {
public static void main(String[] args) {
new DecimalToBinary().run();
}
public void toDecimal(int number){
int binary[] = new int[number];
@iamaamir
iamaamir / linkedlist.c
Created May 29, 2018 05:28
basic implementation of linkedlist in c
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
// const
#define AtBeginning 1
#define AtEnd 0
struct Node
{
@iamaamir
iamaamir / timestamp.py
Created October 4, 2018 13:44
simple Sublime Text 3 plugin to insert Author with timestamp
import sublime, sublime_plugin
from time import localtime, strftime
class InsertDatetimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
format = "%d/%b/%Y/(%I.%M:%p)"
current_date = strftime(format, localtime())
content = "Author: Aamir khan (aamirkhan180@gmail.com)\n{}\n".format(current_date)
sel = self.view.sel();
for s in sel:
if s.empty():
@iamaamir
iamaamir / post.php
Created February 14, 2019 08:56
add a subscriber to mailchimp
<?php
if (isset($_POST['email'])) {
$email = $_POST['email'];
$template = strtr("{\"email_address\": \"%email%\",\"status\": \"subscribed\"}",
array('%email%' => $email));
$curl = curl_init();
@iamaamir
iamaamir / getFakeProfiles.js
Last active February 14, 2019 09:29
get some fake random user profiles
function getFakeProfiles(){
return fetch('https://randomuser.me/api')
.then(res => res.json())
.then(res =>res['results'][0])
.catch(e => e);
}
@iamaamir
iamaamir / helpers.js
Last active May 14, 2019 16:46
js helper functions
// Date object to unix timestamp
function unix(date) {
return Math.round(date.getTime() / 1000);
}
// replace all from string
String.prototype.replaceAll = function(rgx, replacement) {
var self = this;
return self.replace(new RegExp(rgx, "g"), replacement);
};
1. Incognito by David Eagleman
2. How Smart Machines Think by Sean Gerrish
3. The Hundred-Page Machine Learning Book by Andriy Burkov
4. Python Machine Learning (2nd Edition) by Sebastian Rasckha & Vahid Mirjalili
5. Deep Learning by Andrew W. Trask
6. Bayesian Methods For Hackers by Cameron Davidson - Pilon
7. Doing Data Science by Cathy O'Neil & Rachel Schutt
8. Reinforcement Learning by Richard S. Sutton & Andrew G. Barto
9. The Book of Why by Judea Pearl & Dana Mackenzie
10. Quantum Machine Learning by Peter Wittek