Skip to content

Instantly share code, notes, and snippets.

View ajaxray's full-sized avatar
🪁
Exploring

Anis uddin Ahmad ajaxray

🪁
Exploring
View GitHub Profile
@ajaxray
ajaxray / wkhtmltopdf.sh
Last active August 9, 2022 03:28 — forked from Rajeshr34/wkhtmltopdf.sh
Install wkhtmltopdf with Patched QT for CentOS 7 or RHEL 7.x
cd ~
yum install -y xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 openssl git-core fontconfig
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin
# Thanks to
# https://jaimegris.wordpress.com/2015/03/04/how-to-install-wkhtmltopdf-in-centos-7-0/
# https://gist.github.com/Rajeshr34/2e9b2438ff142e51c729b4b9b772680a
@ajaxray
ajaxray / vim-cheat-sheet.md
Last active February 6, 2022 04:14
Vim Cheat Sheet

Vim Cheat Sheet

My collection of vim tips to make the best editor even better. This is by no means complete or a tutorial on how to use vim, but a set of commands I don't want to forget and need to write them down before they burn into memory.

See the resources section below for a more complete introduction and a set of in-depth tutorials.

Navigation

:nn " Jump to line nn

$fileName = 'Billing-Summary.csv';
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename={$fileName}");
header("Expires: 0");
header("Pragma: public");
$fh = @fopen( 'php://output', 'w' );
function asanaRequest($methodPath, $httpMethod = 'GET', $body = null)
{
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api
$url = "https://app.asana.com/api/1.0/$methodPath";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
curl_setopt($ch, CURLOPT_USERPWD, $apiKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@ajaxray
ajaxray / minify-yui.php
Created October 20, 2012 20:42 — forked from phpfour/minify-yui.php
Minification script using YUI compressor
<?php
$contentDir = __DIR__ . '/../web/wp-content/' ;
$yuiCompressor = 'java -jar yuicompressor-2.4.7.jar ';
$files = array();
$files[] = $contentDir . "/themes/power/js/libs/jquery.easing.1.3.js";
$files[] = $contentDir . "/themes/power/js/vehicle-finder.js";
$files[] = $contentDir . "/themes/power/js/script.js";
$files[] = $contentDir . "/themes/power/js/reviews.js";
@ajaxray
ajaxray / upload.js
Created October 20, 2012 20:41 — forked from phpfour/upload.js
HTML5 Upload
(function () {
var input = document.getElementById("image"), formdata = false;
if (window.FormData) {
formdata = new FormData();
}
input.addEventListener("change", function (evt) {