Skip to content

Instantly share code, notes, and snippets.

View captenmasin's full-sized avatar

Mason Day captenmasin

View GitHub Profile
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active July 23, 2024 18:32
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@uran1980
uran1980 / sass-convert_from-sass-to-scss.sh
Last active September 21, 2018 19:12 — forked from atelierbram/sass-convert_from-sass-to-scss.sh
Convert .sass syntax to .scss in terminal
# http://blog.teamtreehouse.com/the-absolute-beginners-guide-to-sass
# Enter the folder you want to convert in your terminal and type in:
# ---------------------------------------------------------------------
# sudo apt get install ruby-sass
# ---------------------------------------------------------------------
sass-convert --from sass --to scss -R .
# where -R means recursively and . means the current directory.
@jonaslejon
jonaslejon / Mailgun PHP API with curl
Last active July 31, 2021 21:29
Send mail with Mailgun API version 2 and PHP. Should also work with version 3 of the Mailgun API
define("DOMAIN", "test.se");
define("MAILGUN_API", "XXX123"); // Mailgun Private API Key
function br2nl($string) {
return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
}
function mg_send($to, $subject, $message) {
$ch = curl_init();
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007