Skip to content

Instantly share code, notes, and snippets.

View josephdicdican's full-sized avatar

josephdicdican

View GitHub Profile
@moreta
moreta / http.js
Last active September 5, 2023 15:27
axios interceptor sample code
/**
* src/api/http.js
*/
import axios from 'axios'
import qs from 'qs'
/**
*
* parse error response
*/
@clemlatz
clemlatz / self-signed-ssl-certificate.md
Last active April 22, 2024 12:30
Setup a self-signed SSL certificate with Nginx (server and browser)

1. Configure server: Nginx

Create the certificate:

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

Create a strong Diffie-Hellman group:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
@albofish
albofish / outputCSV.php
Last active May 4, 2022 03:02
Laravel Chunk Results to CSV
<?php
/*
* Chunk through result set and output as CSV file in browser.
*/
function outputCSV($columns, $query, $chunkSize = 200) {
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename='export-" . date("YmdHis") . ".csv");
header("Pragma: no-cache");
header("Expires: 0");
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install: