Skip to content

Instantly share code, notes, and snippets.

View wall-e-08's full-sized avatar
😠
?

Debashis Roy Bhowmik wall-e-08

😠
?
View GitHub Profile
@wall-e-08
wall-e-08 / no-spinner.css
Last active July 26, 2018 08:08
input type number with no spinner
/* chrome */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* firefox */
input[type=number] {
-moz-appearance:textfield;
@wall-e-08
wall-e-08 / jquery-selector.js
Last active July 26, 2018 10:56
jquery dollar sign selector in plain js
window.$ = function(selector) {
var selectorType = 'querySelectorAll';
if (selector.indexOf('#') === 0) { //if id selector
selectorType = 'getElementById';
selector = selector.substr(1, selector.length);
}
return document[selectorType](selector);
};
@wall-e-08
wall-e-08 / .gitignore
Last active November 27, 2018 10:20
gitignore file for django/python app
env/
env3.6/
.*\.pyc
.*\.swp
.*\.swo
.*\.swn
.idea/
.DS_Store
db.sqlite3
.hg/
function draggable(element) {
var isMouseDown = false;
// initial mouse X and Y for `mousedown`
var mouseX;
var mouseY;
// element X and Y before and after move
var elementX = element.style.left;
var elementY = element.style.top;
@wall-e-08
wall-e-08 / install_django-2.1.3.sh
Last active August 17, 2019 19:25
one command to install django(tested with django=2.1.3) with virtual_env, id, password and all apps in one project folder
#!/bin/bash
#--------------------------------------------
#---- Developer: Debashis Roy Bhowmik -------
#---- Email: debashis.buet08@gmail.com ------
#----------- Website: debashis.me -----------
#-- Github: https://github.com/wall-e-08/ ---
#--------------------------------------------
set -e # Exit immediately if a command exits with a non-zero status.
# sed -e '5ij\n\n\nfjfjfjf' -i file.txt ## insert text at 5th line in file.txt file
# wget -pkr www.website.com/ => to download website
# copy to clipboard by piping: xclip -sel clip
copyfromfile(){
cat $1 | xclip -sel clip
}
alias apt='sudo apt'
@wall-e-08
wall-e-08 / install-django-2.2.4.sh
Last active August 17, 2019 19:26
One command install django(tested with django=2.2.4) with virtual_env, id, password and all apps in one project folder
#!/bin/bash
#--------------------------------------------
#---- Developer: Debashis Roy Bhowmik -------
#---- Email: debashis.buet08@gmail.com ------
#----------- Website: debashis.me -----------
#-- Github: https://github.com/wall-e-08/ ---
#--------------------------------------------
set -e # Exit immediately if a command exits with a non-zero status.
const _slugify = str => {
str = str.toLowerCase();
str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
.trim() // remove starting or ending whitespace before replacing whitespace
.replace(/\s+/g, '-') // collapse whitespace and replace by -
.replace(/-+/g, '-'); // collapse dashes
return str;
}
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const notify = require('gulp-notify');
const sass = require('gulp-sass');
const pug = require('gulp-pug');
const rename = require('gulp-rename');
const auto_prefixer = require('gulp-autoprefixer');
const browser_sync = require('browser-sync').create();
@wall-e-08
wall-e-08 / 2019-https-localhost.md
Created January 17, 2021 09:20 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).