Skip to content

Instantly share code, notes, and snippets.

View vitqst's full-sized avatar
🎯
Focusing

vitqst

🎯
Focusing
View GitHub Profile
@vitqst
vitqst / clean_html.php
Created August 28, 2018 07:11 — forked from xeoncross/clean_html.php
Sanitize HTML using PHP and the DOMDocument
<?php
/**
* Clean HTML string removing all element attributes and elements which are
* not in the provided whitelist (but keeping their allowed children).
*
* @see https://github.com/alixaxel/phunction/blob/master/phunction/HTML.php
* @param string $html to clean
* @param array $whitelist
*/
function clean_html($html, array $whitelist)
var gulp = require('gulp');
var babel = require('gulp-babel');
var babelify = require('babelify');
var uglify = require('gulp-uglify');
var streamify = require('gulp-streamify');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var del = require('del');
var vinylPaths = require('vinyl-paths');
@vitqst
vitqst / gist:a461c5cb86a6d3b09af3b89d7eceb0a2
Created July 31, 2016 11:03 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array