Skip to content

Instantly share code, notes, and snippets.

View fa7ad's full-sized avatar

Fahad Hossain fa7ad

View GitHub Profile
@fa7ad
fa7ad / Makefile
Created October 4, 2017 13:08
A simple makefile for programming practice
appname := myapp
CXX := g++
CXXFLAGS := -Wall -g
srcfiles := $(wildcard *.cpp)
objects := $(srcfiles:.cpp=.o)
all: $(appname)
reset = (cb, interval, timer) ->
if timer then clearInterval timer
setInterval cb, interval
window.jQuery.noConflict() ($) ->
console.info '[sonarr-mpv]', 'Modifying page...'
findTargets = reset modTargets, 1000, findTargets
modtargets = ->
noEl = true
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
using namespace std;
typedef string::iterator strit;
const string charset("0123456789ABCDEF");
##
## Manjaro Linux default mirrorlist
## Generated on 2018-03-15 16:20
##
## Please use 'pacman-mirrors -f [NUMBER] NUMBER' to modify mirrorlist
## (Use 0 for all mirrors)
##
## Country : Bangladesh
#include <iostream>
using namespace std;
class Distance {
int feet;
int inches;
public:
Distance(): feet(0), inches(0){}
Distance(int f, int i): feet(f), inches(i){
if (feet < 0 && inches < 0) {
@fa7ad
fa7ad / code.js
Created May 3, 2018 08:39
Generate all possible 10 digit base-3 combinations
const fs = require('fs')
var combination = Array.from({length: 59049}, (_, num) => (
('0000000000' + Number(num).toString(3)).slice(-10)
))
fs.writeFileSync('combos.txt', combination.join('\n'))
@fa7ad
fa7ad / main.cc
Last active November 8, 2018 04:20
MatrixChainMult.cpp
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
using namespace std;
template <int T>
void multMatrix(array<array<int, T>, T> a, array<array<int, T>, T> b,
array<array<int, T>, T> &res) {
int i, j, k;
import math
from random import randrange
from copy import deepcopy
class Puzzle:
def __init__(self):
self.board = [
[1, 2, 3],
[4, 5, 6],