Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Md. Sumon Islam sumonst21

🏠
Working from home
Block or report user

Report or block sumonst21

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sumonst21
sumonst21 / example.com.conf
Created Nov 15, 2019 — forked from cdolek/example.com.conf
nginx config example for memcached, php fpm and wordpress
View example.com.conf
http {
# memcached servers, generated according to wp-ffpc config
upstream memcached-servers {
server 127.0.0.1:11211;
}
# PHP-FPM upstream; change it accordingly to your local config!
upstream php-fpm {
@sumonst21
sumonst21 / html5-video.md
Created Nov 8, 2019
HTML5 supported video formats.
View html5-video.md

HTML5 Video Formats

Media formats

------------------- ++ --------------------- ++ --------------- | File Extension || Video + Audio Codec || MIME | | ----------------- ++ --------------------- ++ ------------- | | .mp4 || H.264 + AAC || video/mp4 | | .ogg/.ogv || Theora + Vorbis || video/ogg |

@sumonst21
sumonst21 / storage.py
Created Nov 8, 2019 — forked from derekkwok/storage.py
A subclass of FileSystemStorage that checks if content.file has attribute 'temporary_file_path'
View storage.py
import errno, os
from django.conf import settings
from django.core.files import locks
from django.core.files.move import file_move_safe
from django.core.files.storage import FileSystemStorage
class CustomStorage(FileSystemStorage):
"""
This storage class tries to move files instead of copy when saving via
@sumonst21
sumonst21 / encode.py
Created Nov 8, 2019 — forked from derekkwok/encode.py
Simple python script to encode videos using ffmpeg
View encode.py
"""
This python script encodes all files that have the extension mkv in the current
working directory.
Sources:
http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
"""
import subprocess, os
#-------------------------------------------------------------------------------
@sumonst21
sumonst21 / skeleton-daemon.sh
Created Nov 6, 2019 — forked from shawnrice/skeleton-daemon.sh
A template to write a quick daemon as a bash script
View skeleton-daemon.sh
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
@sumonst21
sumonst21 / profiles.json
Created Oct 31, 2019 — forked from trajano/profiles.json
Windows Terminal (with git bash and additional shortcuts)
View profiles.json
{
"globals" :
{
"alwaysShowTabs" : true,
"copyOnSelect" : false,
"defaultProfile" : "{00000000-0000-0000-ba54-000000000001}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
View html5-video-streamer.js
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@sumonst21
sumonst21 / download_nrlist.py
Created Oct 22, 2019 — forked from AntonPetrov/download_nrlist.py
A sample python script for downloading the current non-redundant lists from the RNA 3D Hub
View download_nrlist.py
"""
A sample python script for downloading the current non-redundant lists from
the RNA 3D Hub (http://rna.bgsu.edu/rna3dhub).
Usage:
python download_nrlist.py
"""
@sumonst21
sumonst21 / Encryption.js
Created Oct 8, 2019 — forked from ve3/Encryption.js
Encrypt and decrypt between programming languages (PHP & JavaScript).
View Encryption.js
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {
View verify-google-recaptcha-with-php
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
You can’t perform that action at this time.