Skip to content

Instantly share code, notes, and snippets.

View manniru's full-sized avatar

MUHAMMAD MANNIR AHMAD manniru

View GitHub Profile
from twilio.rest import TwilioRestClient
class TwilioSMS:
def __init__(self):
self.account_sid = "AC0b56c1b6b1ff87e0caaf2c41ee5a7380"
self.auth_token = "d788a0bac58674a4efdd8fdb86c201a6"
def viewsms(self):
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity {
private WebView webview;
/**
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session
* app.
* @author Dandré Allison
*/
public class AccountUtils {
/**
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}.
*/
# Load Json into a Python object
import urllib2
import json
req = urllib2.Request("http://localhost:81/sensors/temperature.json")
opener = urllib2.build_opener()
f = opener.open(req)
json = json.loads(f.read())
print json
print json['unit']
@manniru
manniru / autoexec.py
Last active August 29, 2015 14:10 — forked from schlomo/autoexec.py
# See also http://wiki.xbmc.org/index.php?title=Autoexec.py
# Put this into the userdata folder, see http://wiki.xbmc.org/index.php?title=Userdata for details where this is for each platform
import xbmc
xbmc.executebuiltin('xbmc.PlayMedia("/storage/videos/","isdir")')
xbmc.executebuiltin('xbmc.PlayerControl(repeatall)')
xbmc.executebuiltin("Action(Fullscreen)")

Android Studio Notes

Keyboard Shortcuts for Mac

  • SHIFT + F6 to refactor methods, classes, and variable names
  • CTRL + O to override methods
  • COMMAND + N
    • Generate getter, setter, and constructor method for a class (when in editor pane)
    • Generate new class, files, package, etc. (when in project pane)
  • CTRL+ALT+O to auto-import
  • OPTION + COMMAND + L to reformat code
# Please confirm that you want to reset the MySQL passwords
CONFIRM="n"
echo -n "Please confirm MySQL password reset. Continue? (y/N): "
read -n 1 CONFIRM_INPUT
if [ -n "$CONFIRM_INPUT" ]; then
CONFIRM=$CONFIRM_INPUT
fi
echo
@manniru
manniru / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
package com.twilio;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.twilio.sdk.verbs.Say;
import com.twilio.sdk.verbs.TwiMLResponse;