Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

  • India
View GitHub Profile
@tejastank
tejastank / apitest.php
Created August 26, 2016 13:40 — forked from karlkranich/apitest.php
Updated PHP code to use the Google Sheets API. See usage instructions at http://karl.kranich.org/2015/04/16/google-sheets-api-php/ More examples at https://gist.github.com/karlkranich/afa39e3d778455b38c38
<?php
// apitest.php
// by Karl Kranich - karl.kranich.org
// version 3.1 - edited query section
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php');
include_once "google-api-php-client/examples/templates/base.php";
$client = new Google_Client();
<?php
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php');
include_once "google-api-php-client/examples/templates/base.php";
$client = new Google_Client();
/************************************************
ATTENTION: Fill in these values, or make sure you
have set the GOOGLE_APPLICATION_CREDENTIALS
@tejastank
tejastank / gist:fecc6652218399f9b961e47e82f17932
Created June 20, 2016 07:43 — forked from scmx/upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04
# Reference http://stackoverflow.com/a/18490935/2037928
# Login as root
# Install needed packages
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/
@tejastank
tejastank / google_speech2text.md
Created May 11, 2016 12:16 — forked from alotaiba/google_speech2text.md
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@tejastank
tejastank / phonegap_install.sh
Created May 5, 2016 05:57 — forked from regdog/phonegap_install.sh
How to Install PhoneGap in Ubuntu 12.04 LTS
# 1. install java
# 2. install ant
# 3. install npm and nodejs
# 4. install android sdk
# 5. install phonegap
# 6. create a hello world phonegap app
# 7. lunch android avd(emulator)
# 8. run the app
# 9. add pluins
@tejastank
tejastank / google-drive-upload-pdf.php
Created April 29, 2016 10:20 — forked from hubgit/google-drive-upload-pdf.php
Upload a PDF file to Google Drive
<?php
require 'google-api/apiClient.php';
require 'google-api/contrib/apiOauth2Service.php';
require 'google-api/contrib/apiDriveService.php';
$pdfFile = 'test.pdf';
// API Console: https://code.google.com/apis/console/
// Create an API project ("web applications") and put the client id and client secret in config.ini.
@tejastank
tejastank / ajaxListener.js
Created March 2, 2016 09:14 — forked from icodejs/ajaxListener.js
JS: Listen to ajax calls from Javascript
var open = window.XMLHttpRequest.prototype.open,
send = window.XMLHttpRequest.prototype.send,
onReadyStateChange;
function openReplacement(method, url, async, user, password) {
var syncMode = async !== false ? 'async' : 'sync';
console.warn(
'Preparing ' +
syncMode +
' HTTP request : ' +
@tejastank
tejastank / gist:846bdbfe33e0bd781a13
Created February 1, 2016 18:22 — forked from l4u/gist:3368486
Installing esl-erlang on ubuntu
deb http://binaries.erlang-solutions.com/debian precise contrib
wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install esl-erlang
@tejastank
tejastank / index.php
Created January 23, 2016 11:58 — forked from samt/index.php
<?php
require __DIR__.'/includes/BarcodeBase.php';
require __DIR__.'/includes/QRCode.php';
require __DIR__.'/includes/DataMatrix.php';
require __DIR__.'/includes/PDF417.php';
require __DIR__.'/includes/Code39.php';
require __DIR__.'/includes/Code128.php';
$bcode = array();
@tejastank
tejastank / SecureSessionHandler.php
Created January 8, 2016 13:15 — forked from eddmann/SecureSessionHandler.php
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;