Skip to content

Instantly share code, notes, and snippets.

View Rizwan-Hasan's full-sized avatar
🌏
Working remotely

Rizwan Hasan Rizwan-Hasan

🌏
Working remotely
View GitHub Profile
@Rizwan-Hasan
Rizwan-Hasan / create-package.md
Created August 17, 2021 20:19 — forked from deanrather/create-package.md
Creating a .deb Package

Creating a .deb Package

This creates a package which runs an install.sh which copies a file somewhere the below is entirely incorrect. Hopefully I'll get around to fixing it tip: this would install to the root dir & the relative path to ./install.sh would be wrong

go to project directory

cd /path/to/project
@Rizwan-Hasan
Rizwan-Hasan / dev.conf
Created March 7, 2021 16:42 — forked from fnando/dev.conf
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
# Put this file in /etc/nginx/sites-available
# Then "ln -s /etc/nginx/sites-available/aria2-nginx.conf /etc/nginx/sites-enabled"
# Then "sudo service nginx restart"
server {
listen 80;
listen [::]:80;
root /var/www/aria2; # Put your aria2 web ui here, such as AriaNg
index index.html;
server_name DOMAIN_NAME;
location / {
@Rizwan-Hasan
Rizwan-Hasan / Base64.js
Created February 14, 2021 12:42 — forked from alkaruno/Base64.js
Base64 encode & decode (only for numbers) in JavaScript
var Base64 = (function () {
var ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var Base64 = function () {};
var _encode = function (value) {
if (typeof(value) !== 'number') {
throw 'Value is not number!';
@Rizwan-Hasan
Rizwan-Hasan / git-io-custom-url.md
Created December 21, 2020 16:22 — forked from dikiaap/git-io-custom-url.md
git.io custom URL

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
# ~/.config/systemd/user/jupyter.service
[Unit]
Description=An interactive python notebook server
After=network.target

[Service]
ExecStart=/usr/bin/jupyter notebook\
    --no-browser\
 --port=8001\
@Rizwan-Hasan
Rizwan-Hasan / dark_fusion.py
Last active February 25, 2020 18:32 — forked from lschmierer/dark_fusion.py
Qt5 Dark Fusion Palette for Python
qApp.setStyle(QStyleFactory.create("Fusion"))
darkPalette = QPalette()
darkColor = QColor(45, 45, 45)
disabledColor = QColor(127, 127, 127)
darkPalette.setColor(QPalette.Window, darkColor)
darkPalette.setColor(QPalette.WindowText, Qt.white)
darkPalette.setColor(QPalette.Base, QColor(40, 40, 40))
darkPalette.setColor(QPalette.AlternateBase, darkColor)
@Rizwan-Hasan
Rizwan-Hasan / pyside2_qrunnable_signal_test.py
Created February 21, 2020 10:33 — forked from dalejfer/pyside2_qrunnable_signal_test.py
Run a QTheadPool with signal emitting QRunnable workers. Capture the signals in the main thread and update the UI.
#!python3.7
import random
import time
import PySide2
from PySide2 import QtCore, QtWidgets
from PySide2.QtCore import Slot, Signal, QObject, QThreadPool, QRunnable
class MyEmitter(QObject):
@Rizwan-Hasan
Rizwan-Hasan / fix-git-line-endings
Created August 30, 2019 21:56 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@Rizwan-Hasan
Rizwan-Hasan / README.md
Created June 6, 2019 16:16 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha: