Skip to content

Instantly share code, notes, and snippets.

View boulama's full-sized avatar
💭
69 + 42

Boulama K. boulama

💭
69 + 42
View GitHub Profile
@boulama
boulama / worker.js
Created March 28, 2022 03:03 — forked from izuolan/worker.js
Custom domain for your Craft.do pages. Demo: https://note.zuolan.me and Tutorial: https://zuolan.me/craft_custom_domain_en
// Your domain name
const MY_DOMAIN = 'note.example.com'
// Website language
const LANG = 'en'
// Favicon url
const FAVICON_URL = 'https://example.com/favicon.ico'
// Your config page link
@boulama
boulama / gist:5df75e706e2ffacb39e645f3bec662f5
Created May 2, 2018 00:14 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@boulama
boulama / php-html-css-js-minifier.php
Created January 1, 2018 07:20 — forked from Rodrigo54/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) {