Skip to content

Instantly share code, notes, and snippets.

@matfish2
matfish2 / digitally-sign-document.js
Last active November 19, 2022 07:11
Get Digital Certificate from Node.js Server + Return to PSPDFKit's `signDocument` method
async function digitallySignDocument({fileContents}) {
const blob = new Blob([fileContents], {type: 'application/pdf'});
const formData = new FormData();
formData.append("file", blob);
let {data} = await axios.post('node-server-url.com', formData, {
'Content-Type': 'multipart/form-data'
})
return this.stringToArrayBuffer(data)
@matfish2
matfish2 / index.js
Last active November 21, 2017 18:32
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
var Vue = require('vue/dist/vue');
var VueTables = require('vue-tables-2');
Vue.use(VueTables.ClientTable);
new Vue({
el:'#app',
@matfish2
matfish2 / index.html
Last active October 16, 2016 21:29
Animated Pacman Using Pure CSS (https://jsbin.com/yolufa/edit?html,css,output)
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Animated Pacman Using Pure CSS">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Anmiated Pacman - Pure CSS</title>
<style>
body {
height:100%;
@matfish2
matfish2 / boilerplate.html
Last active December 14, 2015 03:59
HTML: Starting boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 boilerplate—all you really need…</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@matfish2
matfish2 / ValidateEmail.php
Created February 10, 2013 10:22
PHP Email Validation
/**
Validate an email address.
Provide email address (raw input)
Returns true if the email address has the email
address format and the domain exists.
*/
<?php
function validEmail($email)
{
@matfish2
matfish2 / wp-upload-handle.html
Created October 9, 2012 21:57 — forked from paulschreiber/wp-upload-handle.html
WP: upload handling (PHP)
<div class="submit-photos padding-top">
<h2>Photos</h2>
<label for="upload-image-photo">
<input id="upload-image-photo" type="text" size="36" name="upload-image-photo" value="" />
<input id="upload-image-button-photo" class="upload-image-button" type="button" value="Upload Image" />
<br />Upload a picture of yourself
</label>
</div>
@matfish2
matfish2 / custom-posts-helper.php
Created October 9, 2012 21:54 — forked from GreenGeorge/custom-posts-helper.php
WP: Custom Post Types and Custom Taxonomies
<?php
// ***** Declare function that buids the post type
function add_post_type($name, $args = array() ) {
add_action('init',function() use($name, $args) {
// make post type name capitalized
$upper = ucwords($name);
// make name acceptable
@matfish2
matfish2 / copyToClipboard.js
Created April 14, 2012 17:39 — forked from 0xnbk/copyToClipboard.js
JavaScript: Copy to clipboard
function copyToClipboard(meintext) {
if (window.clipboardData)
window.clipboardData.setData("Text", meintext);
else if (window.netscape) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var clip = Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);
if (!clip)
return false;
var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
if (!trans)
@matfish2
matfish2 / WordPress RSS.php
Created March 7, 2012 13:05
WP: Embedding RSS links
<ul>
<?php
include_once(ABSPATH.WPINC.'/rss.php'); // path to include script
$feed = fetch_rss('http://feeds.feedburner.com/blogowicz'); // specify feed url
$items = array_slice($feed->items, 0, 10);
?>
<?php if (!empty($items)) : ?>
<?php foreach ($items as $item) : ?>
<li><a href="<?php echo $item['link']; ?>" rel="nofollow"><?php echo $item['title']; ?></a></li>
@matfish2
matfish2 / form.html
Created March 7, 2012 07:54
PHP: Paypal IPN
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input name="amount" type="hidden" value="COMBIEN_CA_COUTE" />
<input name="currency_code" type="hidden" value="EUR" />
<input name="shipping" type="hidden" value="0.00" />
<input name="tax" type="hidden" value="0.00" />
<input name="return" type="hidden" value="URL_DE_SUCCES" />
<input name="cancel_return" type="hidden" value="URL_ANNULATION" />
<input name="notify_url" type="hidden" value="URL_NOTIFICATION_PAIEMENT" />
<input name="cmd" type="hidden" value="_xclick" />
<input name="business" type="hidden" value="IDENTIFIANT_VENDEUR" />