Skip to content

Instantly share code, notes, and snippets.

@nutanc
nutanc / GmailHelper.java
Created July 14, 2014 04:27
Helper class for Gmail API to send and receive mails
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.TokenResponse;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleTokenResponse;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;
#!/bin/sh
#
# Add a Google Analytics tag to static website files
# @see http://adambuchanan.me/post/26345221717/updating-google-analytics-code-on-many-static-pages
# Tested on MacOS 10.8.X
#
# Usage:
# Set the GA parameters below
# Execute the script from the top-level of the static site
#
@nutanc
nutanc / overlay.py
Last active July 11, 2016 06:16
Overlay one image over another
import sys
import cv2
import argparse
def detectObjects(image):
"""Converts an image to grayscale and returns the locations of any faces found"""
grayscale = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cascade = cv2.CascadeClassifier(
'haarcascade_frontalface_alt2.xml')
@nutanc
nutanc / face_replace.py
Created July 11, 2016 05:59
Face Replace
#!/usr/bin/python
# face_replace.py
# Usage: python face_replace.py <image_file> [face index]
import sys
import cv2
def detectObjects(image):
"""Converts an image to grayscale and returns the locations of any faces found"""
grayscale = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
<?php
session_start();
require_once('response.php');
$kk = new Response();
if (isset($_REQUEST['event']) && ($_REQUEST['event'] == 'NewCall')){
/*New Call Request */
$kk->addPlayText("please enter or say ten digits mobile number to which amount is to be transffered. after the beep",'2','best');
$kk->addRecognize('indybol','digits_hi',5,15,'en',10);
$_SESSION['block'] = 'menu1_output';
}
/**
* @OnlyCurrentDoc Limits the script to only accessing the current presentation.
*/
/**
* Create a open translate menu item.
* @param {Event} event The open event.
*/
function onOpen(event) {
SlidesApp.getUi().createAddonMenu()
SECTION |
2022-23
=e
~~,
epee nie SS
. a
@nutanc
nutanc / telugu.md
Created September 17, 2024 05:19
Language learning format for Telugu

Auto Conversation

You will learn common phrases to deal with traveling in the city. Select any word/phrase to see the corresponding translation. Some of these are not gramatically correct. Thats not the goal. The goal is to introduce some sommon words and phrases. Not a lot of gamification or anything like duolingo. Just words and phrases. Repeat as you need. If you want to relearn, just delete local storage and try again. Model for writing: Each step should teach one concept. Like "come here". Or "I will be late" etc. Each step is separated by "---"

x-tts is a web component which will playback what is provide. Takes an attribute of the language. It will emit event tts_done when someone clicks on it.

import requests
import json
from bs4 import BeautifulSoup
def extract_text_from_url(url):
try:
# Send a GET request to the URL
response = requests.get(url)
response.raise_for_status() # Raise an exception for bad status codes
We are at the community center. At the center, we can help. We can donate clothes. We can give food. We can help clean up. We can meet new friends. We are happy helping at the center.
We are at a family reunion. At the reunion, we can meet relatives. We can eat together. We can share stories. We can play games. We can take pictures. We are happy with our family.
We are at a charity event. At the event, we can raise money. We can sell crafts. We can bake cookies. We can sing songs. We can help others. We are happy at the charity event.