Skip to content

Instantly share code, notes, and snippets.

View vin-ai's full-sized avatar
🐍
Pythoning

Vinay Kumar Sharma vin-ai

🐍
Pythoning
View GitHub Profile
@vin-ai
vin-ai / Yii-MailGun.php
Last active April 27, 2017 22:53
PHP Class for Yii PHP Framework to Send E-mails using Curl. It's uses MailGun API to send emails.
<?php
/**
* MailGun PHP Curl Client
*
* @version 1.1b
* @copyright &copy; 2015, VINAY KUMAR SHARMA <vinaykrsharma@live.in>
* @author VINAY KUMAR SHARMA
*/
class MailGun extends CApplicationComponent {
"""
To use this, add::
MIDDLEWARE_CLASSES += ('airmozilla.base.middleware.JsonAsHTML',)
to your settings and for any AJAX request, you can open it
separately and add `&_debug=true` to the URL.
"""
from urllib import quote
@guifromrio
guifromrio / compress-pdf-with-gs.md
Created August 30, 2013 14:39
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@dashohoxha
dashohoxha / install_wifi_access_point.sh
Last active October 12, 2022 22:43
How to setup a Wifi Access Point on Ubuntu 12.04 (or its derivatives).
#!/bin/bash
### Setup a wifi Access Point on Ubuntu 12.04 (or its derivatives).
### make sure that this script is executed from root
if [ $(whoami) != 'root' ]
then
echo "
This script should be executed as root or with sudo:
sudo $0
"