Skip to content

Instantly share code, notes, and snippets.

Avatar
☢️
approach with caution, might meltdown

Fahad Hossain fa7ad

☢️
approach with caution, might meltdown
View GitHub Profile
View link-ffmpeg-so.sh
@fa7ad
fa7ad / Makefile
Created Oct 4, 2017
A simple makefile for programming practice
View Makefile
appname := myapp
CXX := g++
CXXFLAGS := -Wall -g
srcfiles := $(wildcard *.cpp)
objects := $(srcfiles:.cpp=.o)
all: $(appname)
View sonarr.coffee
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
View index.html
<!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">
View labmid.cc
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
using namespace std;
typedef string::iterator strit;
const string charset("0123456789ABCDEF");
View mirrorlist
##
## 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
View operator-overloading.cc
#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
Generate all possible 10 digit base-3 combinations
View code.js
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 Nov 8, 2018
MatrixChainMult.cpp
View main.cc
#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;
View 8puzzle.py
import math
from random import randrange
from copy import deepcopy
class Puzzle:
def __init__(self):
self.board = [
[1, 2, 3],
[4, 5, 6],