Skip to content

Instantly share code, notes, and snippets.

View Chitrank-Dixit's full-sized avatar
🎯
Focusing

Chitrank Dixit Chitrank-Dixit

🎯
Focusing
View GitHub Profile
@Chitrank-Dixit
Chitrank-Dixit / linkedin_data.php
Created December 26, 2013 14:26
Get Data from Linkedin after authorization
<?php
// Change these
define('API_KEY', 'Your App API KEY' );
define('API_SECRET', 'Your App API SECRET' );
define('REDIRECT_URI', 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']);
define('SCOPE', 'r_fullprofile r_emailaddress rw_nus' );
// You'll probably use a database
session_name('linkedin');
session_start();
@Chitrank-Dixit
Chitrank-Dixit / sendJson.js
Created November 9, 2013 11:35
Send the Form Data as JSON in Knockoutjs
// write this under Knockout viewModel
// This is an example to send all the users comments to the server
// Basic Example we can fit it for other purposes as well
self.save = function() {
return $.ajax({
url: "comments.php",
contentType: 'application/json',
type: 'POST',
data: JSON.stringify({
@Chitrank-Dixit
Chitrank-Dixit / getJson.js
Last active December 27, 2015 20:29
get JSON data from any url in knockoutjs
// write this snippet inside the Knockout viewModel
// getting all the comments from the server
$.getJSON("comments.php", function(commentModels) {
var t = $.map(commentModels.comments, function(item) {
return new Comment(item);
});
self.comments(t);
});
@Chitrank-Dixit
Chitrank-Dixit / custom_panel.css
Created November 4, 2013 15:58
Customized Panels that we used in Eventus trending_event.html and profile.html
.well-inverse {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid #e3e3e3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
/* -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.05);
@Chitrank-Dixit
Chitrank-Dixit / app.py
Created September 20, 2013 04:15 — forked from scturtle/app.py
from flask import Flask, request, session, redirect, url_for
import urllib
import requests
app = Flask(__name__)
app.secret_key = 'iwonttellyou'
redirect_uri = 'http://localhost:5000/callback'
client_id = '' # get from https://code.google.com/apis/console
client_secret = ''