Skip to content

Instantly share code, notes, and snippets.

View robwent's full-sized avatar
💭
Doing 'stuff'

Robert Went robwent

💭
Doing 'stuff'
View GitHub Profile
@jordymeow
jordymeow / sse.php
Created May 27, 2023 01:28
SSE (Server-Sent Events) with PHP and JS / Streaming with PHP
<?php
// Various links
// https://serverfault.com/questions/488767/how-do-i-enable-php-s-flush-with-nginxphp-fpm
// https://stackoverflow.com/questions/72394213/nginx-configuration-for-server-sent-event
// https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate
// https://qiita.com/okumurakengo/items/cbe6b3717b95944083a1 (in Japanese)
// If '?SSE' is set, send Server-Sent events, otherwise we'll display the page.
if ( isset( $_GET['SSE'] ) ) {
@thomasfw
thomasfw / wpmail-enhanced-attachments.php
Last active October 18, 2024 18:53
Enable non-filesystem attachments with wp_mail()
<?php
/**
* Plugin Name: Enhanced WP Mail Attachments
* Plugin URI: https://gist.github.com/thomasfw/5df1a041fd8f9c939ef9d88d887ce023/
* Version: 0.1
*/
/**
* Adds support for defining attachments as data arrays in wp_mail().
@rlafranchi
rlafranchi / nimiq-node-digital-ocean.md
Last active November 13, 2023 13:43
Setting up a Nimiq Node on DigitalOcean

Running a Nimiq Node on a Digital Ocean droplet

I thought I would put this quick tutorial together to help out anyone interested in contributing a node to the Nimiq network, also feel free to sign up using my referral link which will give you a $10 credit - https://m.do.co/c/0e575aa2cb44

requires some basic shell skills

First steps

  • Create a droplet and pick an operating system (we'll Use Ubuntu as an example)
  • Select a droplet size (If you are mining expect to get around 1 to 1.5kh/s per cpu core for a standard droplet)
  • Once the droplet is created, be sure to configure your desired domain name's dns settings to point to the assigned ip address for the droplet. In this example we'll be using nimiq.example.com
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active October 19, 2024 18:33
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}
@matthewbeta
matthewbeta / scrim-gradient.scss
Last active September 5, 2024 10:18
A simple little SCSS mixin for creating scrim gradients
/*
A simple little SCSS mixin for creating scrim gradients
Inspired by Andreas Larson - https://github.com/larsenwork
https://css-tricks.com/easing-linear-gradients/
*/
@mixin scrimGradient($startColor: $color-black, $direction: 'to bottom') {
$scrimCoordinates: (
@robwent
robwent / k2commentexport.php
Last active August 29, 2015 14:19
Exports K2 comments to be imported into Disqus (Wordpress format)
<?php
// Turn off all error reporting
error_reporting(0);
/**
* Constant that is checked in included files to prevent direct access.
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
@gene1wood
gene1wood / batch-delete-gmail-emails.js
Last active August 30, 2024 15:55
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
/*
This script, when used with Google Apps Scripts, will delete 400 emails and
can be triggered to run every few minutes without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Google returns a maximum of 500 email threads in a single API call.
This script fetches 400 threads in case 500 threads is causing timeouts
Configure the search query in the code below to match the type of emails
you want to delete
@jmcclellan
jmcclellan / wpseo_breadcrumb_links.php
Created September 28, 2014 01:18
Override Yoast SEO Breadcrumb Trail
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!