Skip to content

Instantly share code, notes, and snippets.

View proficientdesigners's full-sized avatar
🎯
Focusing

Proficient Designers proficientdesigners

🎯
Focusing
View GitHub Profile
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
main() {
CustomNavigationHelper.instance;
runApp(const App());
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@proficientdesigners
proficientdesigners / myplugin-media.js
Created January 26, 2023 06:07 — forked from cferdinandi/myplugin-media.js
Adding a Media Uploader to a custom metabox
/**
* Load media uploader on pages with our custom metabox
*/
jQuery(document).ready(function($){
'use strict';
// Instantiates the variable that holds the media library frame.
var metaImageFrame;
@proficientdesigners
proficientdesigners / download.js
Created May 7, 2022 11:38 — forked from larryyangsen/download.js
axios download audio file
const { data } = await axios.get(url, {
responseType: 'arraybuffer',
headers: {
'Content-Type': 'audio/wav'
}
});
const blob = new Blob([data], {
type: 'audio/wav'
});
@proficientdesigners
proficientdesigners / countries.json
Created February 1, 2022 09:05 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@proficientdesigners
proficientdesigners / typescript-crash.ts
Created January 23, 2022 04:02 — forked from bradtraversy/typescript-crash.ts
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@proficientdesigners
proficientdesigners / emails.php
Created January 2, 2022 05:04 — forked from tameemsafi/emails.php
Send an email programmatically in wordpress with wp_mail using the woocommerce transaction emails template.
<?php
// Define a constant to use with html emails
define("HTML_EMAIL_HEADERS", array('Content-Type: text/html; charset=UTF-8'));
// @email - Email address of the reciever
// @subject - Subject of the email
// @heading - Heading to place inside of the woocommerce template
// @message - Body content (can be HTML)
function send_email_woocommerce_style($email, $subject, $heading, $message) {
@proficientdesigners
proficientdesigners / axios-catch-error.js
Created September 11, 2021 08:33 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@proficientdesigners
proficientdesigners / imagemagick-trim-transparent.sh
Created March 3, 2021 12:10 — forked from juliendargelos/imagemagick-trim-transparent.sh
Imagemagick command that trim transparent pixels from an image.
convert input.png -trim +repage output.png