Skip to content

Instantly share code, notes, and snippets.

@RHAF05
RHAF05 / download_base64_ajax.js
Created April 23, 2022 03:31
How to download file in base64 format using ajax request
$.ajax({
url: "https://api.yoursite.com",
type: 'GET',
data: data,
}).done(function(res){
var a = document.createElement('a');
a.href = 'data:application/pdf;base64,' + res;
a.download = 'documents.pdf';
document.body.append(a);
a.click();
@RHAF05
RHAF05 / job_control_zsh_bash.md
Created November 1, 2020 22:18 — forked from CMCDragonkai/job_control_zsh_bash.md
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@RHAF05
RHAF05 / job_control_zsh_bash.md
Created November 1, 2020 22:18 — forked from CMCDragonkai/job_control_zsh_bash.md
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@RHAF05
RHAF05 / redis_migrate.py
Last active July 15, 2020 00:57 — forked from josegonzalez/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'],
password=conn_dict['passw'])