Skip to content

Instantly share code, notes, and snippets.

View sendtomitesh's full-sized avatar

Mitesh Patel sendtomitesh

View GitHub Profile
@sendtomitesh
sendtomitesh / gist:d50e31c13b30e04a27fa62ca79e6e132
Created September 19, 2017 07:05 — forked from mhawksey/gist:5705633
Google Apps Script to send emails when an new Google Site Announcement is made (In response to https://plus.google.com/109310290306060614500/posts/JYMPQ2mLuEt )
/*
1. Set two variables below
2. Run > setup (twice, once to authenticate the script, second to actually run
3. Rescources > Current project trigger's and then click 'No triggers set up. Click here to add one now.'
You can accept the defaults to run emailAnnouncements() every hour
*/
var url_of_announcements_page = "https://sites.google.com/site/appsscripttemplates/home/announcetest"; // where your site page is
var who_to_email = "youremail@example.com" // who to send to (it can be a comma seperated list)
sp_configure ‘show advanced options’, 1;
GO
RECONFIGURE;
GO
sp_configure ‘Ole Automation Procedures’, 1;
GO
RECONFIGURE;
GO
function (startDate, endDate, addFn, interval) {
addFn = addFn || Date.prototype.addDays;
interval = interval || 1;
var retVal = [];
var current = new Date(startDate);
while (current <= endDate) {
retVal.push(new Date(current));
{
"rules": [
{
"rule-type": "selection",
"rule-id": "1",
"rule-name": "1",
"object-locator": {
"schema-name": "Test",
"table-name": "%"
},
Check for the ports open
give password to root user
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'yourpass'
@sendtomitesh
sendtomitesh / MediaPlayerStateWrapper.java
Created April 6, 2016 06:15 — forked from bitops/MediaPlayerStateWrapper.java
A drop-in replacement for a MediaPlayer instance, that provides an accessor for the current state.
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import android.media.AudioManager;
import android.media.MediaPlayer;
@sendtomitesh
sendtomitesh / Logcat.java
Created March 10, 2016 08:12 — forked from Antarix/Logcat.java
Simple extension of android Logcat class which makes easy to change debugging mode.
import android.util.Log;
public class Logcat{
/*
* ALLOW_LOG to enable or disable debugging log
*/
private static final boolean ALLOW_LOG = true;
git config core.filemode false
@sendtomitesh
sendtomitesh / Imaging.php
Created October 13, 2015 11:32 — forked from Antarix/Imaging.php
Create thumbnail of image while uploading
<?php
class Imaging
{
// Variables
private $img_input;
private $img_output;
private $img_src;
private $format;
@sendtomitesh
sendtomitesh / MultiPartUtility.java
Created October 13, 2015 09:32 — forked from Antarix/MultiPartUtility.java
Uploading Multiple files at once with Post and Header parameter in Android
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;