Skip to content

Instantly share code, notes, and snippets.

View shashisp's full-sized avatar
🎯
Focusing

Shashi shashisp

🎯
Focusing
View GitHub Profile
@shashisp
shashisp / gist:8703545
Created January 30, 2014 06:19
textcarousel example
<div id="container">
This is the
<div id="caption">
<span>best</span>
<span>ultimate</span>
<span>excellent</span>
<span>fantastic</span>
</div>
website in town.
</div>
@shashisp
shashisp / adddata.html
Last active August 29, 2015 13:59
django forms example
{% extends "base.html" %}
{% block content %}
<hr/>
<center>
<form action="/adddata/" class="form-vertical" method="post"> {% csrf_token %}
<p>
{{ form.as_p }}
<Response>
<Dial callerId="919035162272">
<User>sip:shashisp140702194927@phone.plivo.com</User>
</Dial>
</Response>
@shashisp
shashisp / urls.py
Created July 10, 2014 22:50
Django-REST-Example
from vendors import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'organisations', views.OraganisationViewSet)
urlpatterns = patterns('',
url(r'^api/', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
@shashisp
shashisp / serializer.py
Created July 10, 2014 22:54
Django-REST-Example
from .models import Organisation
from rest_framework import serializers
class OrganisationSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Organisation
fields = ('name', 'service_type', 'address', 'city', 'contact', 'logo', 'description')
@shashisp
shashisp / views.py
Created July 10, 2014 22:57
Django-REST-Example
from rest_framework import viewsets
from vendors.serializers import OrganisationSerializer
class OraganisationViewSet(viewsets.ModelViewSet):
queryset = Organisation.objects.all()
serializer_class = OrganisationSerializer
paginate_by = 10
paginate_by_param = "page_size"
@shashisp
shashisp / gist:ca111827f99c045aa96d
Created October 24, 2014 17:47
simple rock paper scissor game
from random import choice
name = raw_input("Enter your name : ")
rps = ['r','p','s']
u = 0
c = 0
while 1:
print "R: Rock, P: Paper, S: Scissor"
{
"objects": [
{
"resource_uri": "#",
"id": 2,
"name": "Software",
"slug": "software"
},
{
"resource_uri": "#",
@shashisp
shashisp / gist:1aa50a6a430a242b94ef
Last active January 17, 2016 13:42
Node resources
LOl! i was trying to help one of my junior, to get started with Node, Ignore if anything wrong i am a python guy :D
To get started with Node.js and basic stuffs
go through this link:
http://campus.codeschool.com/courses/real-time-web-with-node-js/contents
Once you r familiar with node, its time to build some basic app,
Here you go, the link for building simple blogging app with all detailed steps
http://howtonode.org/express-mongodb
@shashisp
shashisp / heatmap.js
Created March 21, 2015 15:11
heatmap.js
/*
* heatmap.js v2.0.0 | JavaScript Heatmap Library
*
* Copyright 2008-2014 Patrick Wied <heatmapjs@patrick-wied.at> - All rights reserved.
* Dual licensed under MIT and Beerware license
*
* :: 2014-08-05 01:42
*/
(function(a){var b={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};var c=function i(){var a=function d(a){this._coordinator={};this._data=[];this._radi=[];this._min=0;this._max=1;this._xField=a["xField"]||a.defaultXField;this._yField=a["yField"]||a.defaultYField;this._valueField=a["valueField"]||a.defaultValueField;if(a["radius"]){this._cfgRadius=a["radius"]}};var c=b.defaultRadius;a.prototype={_organiseData:function(a,b){var d=a[this._xField];var e=a[this._yField];var f=this._radi;var g=this._data;var h=this._max;var i=this._min;var j=a[this._valueField]||1;var k=a.radius||this._cf