Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
| <?php | |
| $url = 'http://en.wikipedia.org/wiki/1,1,1-Trichloroethane'; // example | |
| $config = HTMLPurifier_Config::createDefault(); | |
| $config->set('URI.Base', $url); // set the base URL (overrides a <base element in the HTML head?) | |
| $config->set('URI.MakeAbsolute', true); // make all URLs absolute using the base URL set above | |
| $config->set('AutoFormat.RemoveEmpty', true); // remove empty elements | |
| $config->set('HTML.Doctype', 'XHTML 1.0 Strict'); // valid XML output (?) | |
| $config->set('HTML.AllowedElements', array('p', 'div', 'a', 'br', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'ul', 'ol', 'li', 'b', 'i')); |
| Class Main { | |
| public void bfs() | |
| { | |
| // BFS uses Queue data structure | |
| Queue queue = new LinkedList(); | |
| queue.add(this.rootNode); | |
| printNode(this.rootNode); | |
| rootNode.visited = true; | |
| while(!queue.isEmpty()) { | |
| Node node = (Node)queue.remove(); |
| #!/usr/bin/env python | |
| """ | |
| Very simple HTTP server in python (Updated for Python 3.7) | |
| Usage: | |
| ./dummy-web-server.py -h | |
| ./dummy-web-server.py -l localhost -p 8000 | |
| Send a GET request: |
| <?php | |
| $files = array_slice($argv, 1); | |
| foreach ($files as $file) { | |
| $picture = file_get_contents($file); | |
| $size = getimagesize($file); | |
| // base64 encode the binary data, then break it into chunks according to RFC 2045 semantics | |
| $base64 = chunk_split(base64_encode($picture)); |
| // use keys as search and values as replace | |
| function str_replace_assoc(array $replace, $subject) { | |
| return str_replace(array_keys($replace), array_values($replace), $subject); | |
| } |
| $.ajaxSetup({ | |
| beforeSend: function(xhr, settings) { | |
| if (settings.type == 'POST' || settings.type == 'PUT' || settings.type == 'DELETE') { | |
| function getCookie(name) { | |
| var cookieValue = null; | |
| if (document.cookie && document.cookie != '') { | |
| var cookies = document.cookie.split(';'); | |
| for (var i = 0; i < cookies.length; i++) { | |
| var cookie = jQuery.trim(cookies[i]); | |
| // Does this cookie string begin with the name we want? |
| <?php | |
| // DEFINE our cipher | |
| define('AES_256_CBC', 'aes-256-cbc'); | |
| // Generate a 256-bit encryption key | |
| // This should be stored somewhere instead of recreating it each time | |
| $encryption_key = openssl_random_pseudo_bytes(32); | |
| // Generate an initialization vector | |
| // This *MUST* be available for decryption as well |
| <?php | |
| /* | |
| * Recursively diff two arrays. This function expects the leaf levels to be | |
| * arrays of strings or null | |
| */ | |
| function diff_recursive($array1, $array2) { | |
| $difference=array(); | |
| foreach($array1 as $key => $value) { | |
| if(is_array($value) && isset($array2[$key])){ // it's an array and both have the key | |
| $new_diff = diff_recursive($value, $array2[$key]); |
| #!/bin/sh | |
| sudo apt-get install apache2-prefork-dev libxml2 libxml2-dev apache2-dev | |
| mkdir ~/modbuild/ && cd ~/modbuild/ | |
| wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.c | |
| wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.h | |
| sudo apxs2 -aic -I/usr/include/libxml2 ./mod_xml2enc.c | |
| cd ~ | |
| sudo rm -rfd ~/modbuild/ | |
| sudo service apache2 restart |