Skip to content

Instantly share code, notes, and snippets.

View venkatesh22's full-sized avatar

Venkatesh venkatesh22

View GitHub Profile
title
file with a leading space = GIST title
http://stackoverflow.com/questions/19896900/how-to-change-the-name-of-a-gist-in-github
@venkatesh22
venkatesh22 / chart.js
Created May 5, 2016 17:55 — forked from chrtze/chart.js
Line Chart Example
var Chart = (function(window,d3) {
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator;
var breakPoint = 768;
d3.csv('data.csv', init); //load data, then initialize chart
//called once the data is loaded
function init(csv) {
@venkatesh22
venkatesh22 / index.html
Created April 26, 2016 11:09 — forked from benjchristensen/index.html
Simple Line Graph using SVG and d3.js
<html>
<head>
<title>Simple Line Graph using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@venkatesh22
venkatesh22 / AuthenticationInterceptor.ts
Created February 29, 2016 13:19 — forked from adhamankar/AuthenticationInterceptor.ts
Implementing angularjs Interceptor using TypeScript
module App {
"use strict";
//Method name should be exactly "response" - http://docs.angularjs.org/api/ng/service/$http
export interface IInterceptor {
request: Function;
requestError: Function;
response: Function;
responseError: Function;
}
@venkatesh22
venkatesh22 / typescript_angular.adoc
Created January 20, 2016 12:42 — forked from esfand/typescript_angular.adoc
AngularJS with TypeScript
@venkatesh22
venkatesh22 / build-and-deploy.sh
Last active September 21, 2015 18:52 — forked from jrschumacher/build-and-deploy.sh
Ionic Automated Build and Deploy to HockeyApp
#!/bin/bash
PROJECT_NAME=MyApp
SCHEME_NAME=MyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
angular.module('app').controller('Control', function($scope) {
// data from form will go here
$scope.formModel = {};
// field definition here - could also pull from server
$scope.fields = [
{attr: 'firstName', label: 'First Name', required: true, type: 'text', required: true},
{attr: 'lastName', label: 'Last Name', required: true, type: 'text'}
];
})
smtp mail sending in cPython blocks the GIL.
This code is tested on python 2.7.8 and I'm using it with web2py
If you use Google Apps for your domain email and if you have admin access, you can easily use the gmail api.
Because you have admin access, you can create a "service account" in the Google Developer Console.
This makes authentication easy.
There are other authorisation methods when you don't have admin access, but they require interaction from the user via a browser.
To use this, you need to install these modules (From PyPI):
pyOpenSSL
@venkatesh22
venkatesh22 / index.html
Last active August 29, 2015 14:10 — forked from elsewhat/index.html
<html>
<head>
<title></title>
<script type="text/javascript" charset="utf-8" src="phonegap/cordova-1.6.0.js"></script>
<script id="sap-ui-bootstrap"
type="text/javascript"
src="sapui5/resources/sap-ui-core.js"
data-sap-ui-theme="sap_platinum"
#!/usr/bin/python
A = [1, 8, -3, 0, 1, 3, -2, 4, 5]
def solution(K, A):
contenga = {}
for x in A:
if x not in contenga:
contenga[x] = 0
contenga[x] += 1