Skip to content

Instantly share code, notes, and snippets.

@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active April 23, 2024 23:58 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@apolloclark
apolloclark / Twitter API with Curl
Last active November 10, 2023 11:36
Twitter API with Curl
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
@typhonius
typhonius / greentext.module
Last active February 11, 2019 08:23
A filter format for applying greentext correctly to Drupal text. The snippet will provide any filter format with the ability to change any line starting with '>' into a greentext line. >Implying anyone will use it
<?php
function greentext_filter_info() {
$filters['greentext'] = array(
'title' => t('Implying greentext'),
'description' => t('Allows you to alter any lines input starting with \'>\' to appear as greentext.'),
'process callback' => '_greentext_greentext',
'tips callback' => '_greentext_greentext_tips',
);
return $filters;