Skip to content

Instantly share code, notes, and snippets.

View SyntaxError843's full-sized avatar
👌
Can't spell success without succ

SyntaxError843

👌
Can't spell success without succ
View GitHub Profile
@karlhillx
karlhillx / laravel-8-laravel-mix-6-font-awesome.md
Last active August 25, 2023 14:29
Want to use Laravel 8 and Font Awesome 5? (Regularly updated)

Laravel asset compilation for Laravel 8 + Laravel Mix 6 + Font Awesome 5

This document provides help to get your Laravel 8 instance running with the latest versions of Laravel Mix and Font Awesome.

Laravel Mix

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@danallison
danallison / downloadString.js
Created September 29, 2014 16:44
download string as text file
function downloadString(text, fileType, fileName) {
var blob = new Blob([text], { type: fileType });
var a = document.createElement('a');
a.download = fileName;
a.href = URL.createObjectURL(blob);
a.dataset.downloadurl = [fileType, a.download, a.href].join(':');
a.style.display = "none";
document.body.appendChild(a);
a.click();
@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,