Skip to content

Instantly share code, notes, and snippets.

View shafayeatsumit's full-sized avatar
👓
Working on my algo skills

Shafayeat Kabir Sumit shafayeatsumit

👓
Working on my algo skills
  • Dhaka, Bangladesh
View GitHub Profile
@shafayeatsumit
shafayeatsumit / stream.js
Created January 28, 2021 13:00 — forked from DingGGu/stream.js
NodeJS Mp3 Streaming ExpressJS
var express = require('express');
var app = express();
var fs = require('fs');
app.listen(3000, function() {
console.log("[NodeJS] Application Listening on Port 3000");
});
app.get('/api/play/:key', function(req, res) {
var key = req.params.key;
@shafayeatsumit
shafayeatsumit / clean_code.md
Created August 14, 2018 04:34 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@shafayeatsumit
shafayeatsumit / example_image_utils.py
Created March 14, 2018 04:38 — forked from turicas/example_image_utils.py
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText
@shafayeatsumit
shafayeatsumit / gist:860e080f3cd0c3b42b2f511a3bd88e16
Created October 31, 2017 07:34 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@shafayeatsumit
shafayeatsumit / a) understandJS.md
Created October 10, 2017 05:28 — forked from LearningMaterial/a) understandJS.md
Notes of Javascript_The_Weird_Parts

Javascript Understanding The Weird Parts

@shafayeatsumit
shafayeatsumit / demo_movie-countdown.jsx
Created October 8, 2017 13:45 — forked from seblavoie/demo_movie-countdown.jsx
AeTuts+ movie countdown script
{
app.beginUndoGroup("Demo Script");
// Creating project
var currentProject = (app.project) ? app.project : app.newProject();
// Creating comp
var compSettings = cs = [1280, 720, 1, 10, 24];
var defaultCompName = "Demo"
var currentComp = (currentProject.activeItem) ? currentProject.activeItem : currentProject.items.addComp(defaultCompName, cs[0], cs[1], cs[2], cs[3], cs[4]);
# -*- coding: utf-8 -*-
import json
import re
# Import Scrapy stuff
import scrapy
import time
from scrapy import signals
from scrapy.http import HtmlResponse
import requests
import socket
import socks
import csv
import sqlite3
import datetime
from scrapy.http import HtmlResponse
socks.set_default_proxy(socks.SOCKS5, "proxy.torguard.io", 1090, username="", password="")
from selenium.webdriver.common.proxy import *
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
proxy = {'address': '191.101.24.45:8085'}
capabilities = dict(DesiredCapabilities.CHROME)