Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
[
{
"caption": "SublimeREPL: SML",
"command": "run_existing_window_command", "args":
{
"id": "repl_sml",
"file": "config/SML/Main.sublime-menu"
}
}
]
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
@alagappanr
alagappanr / android_top_games.py
Created May 2, 2014 18:27
A simple python script that scrapes the Android Top Charts page to get the list of top 20 games in each of the "Top Free", "Top Paid" and "Top Grossing" categories and write it into a file as json. Repeats the process every 1 hour.
#!/usr/bin/env python
"""
# Program to ping the Android Top Charts page every once
# in a while to get the top games and store it into a
# JSON file for processing later
# Crude version of code. Requires cleaning up.
# Author: Alagappan Ramu
# Version: 0.1
@alagappanr
alagappanr / search_box.js
Last active August 29, 2015 13:57
Modifying an existing 'advanced search' option with custom options. Rough code.
<link rel="stylesheet" href="/etc/designs/www/news/css/jquery-ui.css" />
<script src="/etc/designs/www/news/js/jquery-ui.js"></script>
<script type="text/javascript">
$(function(){
var startDateVal, endDateVal, dateRange;
//Edit the string for the number of returned results
@alagappanr
alagappanr / install.sh
Created March 7, 2014 15:37
Simple bash commands to install and uninstall my application on 5 Android Emulators. Everything is hardcoded. No customizations. Cannot be reused.
cd /Users/aramu/Code/Masters/Distributed/GroupMessenger/bin
adb -s emulator-5554 install GroupMessenger.apk
adb -s emulator-5556 install GroupMessenger.apk
adb -s emulator-5558 install GroupMessenger.apk
adb -s emulator-5560 install GroupMessenger.apk
adb -s emulator-5562 install GroupMessenger.apk
cd -
#!/usr/bin/python
import datetime
import os
import sys
t1 = datetime.datetime.now()
os.system("java -cp ../bin:../other/jsqlparser.jar edu.buffalo.cse562.Main --data /../data /../sqlfile/"+sys.argv[1]+" > "+sys.argv[1]+".dat")
t2 = datetime.datetime.now()
diff = t2-t1
print diff
print diff.seconds
@alagappanr
alagappanr / checkUBCampusJobs.py
Created February 28, 2014 18:44
A simple Python script that uses the Urlliib and BeautifulSoup modules to check whether a new job has been posted on www.myubcard.com/jobs which is where the part-time campus jobs in UB are updated. This scripts pings to the specified URL every once in a while and then parses through the response to see if any new job has been posted. Note: Woul…
#!/usr/bin/python
import sys
import time
import urllib
import smtplib
import datetime
import traceback
from bs4 import BeautifulSoup
def sendemail(exception=false):
@alagappanr
alagappanr / JavaHTTPConnection
Created November 20, 2013 16:49
HTTP Connect in Java
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
@alagappanr
alagappanr / GoyakaRadios.py
Created September 21, 2013 18:44
A simple and quick program which calls the Facebook Graph API url for the Goyaka Radios FB Group (https://www.facebook.com/groups/goyakaradios/), reads its feed and tweets it to Twitter (http://twitter.com/GoyakaRadios). Feedback/Suggestions/Improvements are welcome.
"""Program to Tweet from Goyaka Radios FB Group"""
__author__ = 'Alagappan'
__version__ = '0.1'
import requests
import twitter
#import pdb
import time
FB_CONFIG = {'app_id' : "FB_APP_ID",