Skip to content

Instantly share code, notes, and snippets.

View vikitripathi's full-sized avatar

Abhishek Dutt vikitripathi

  • Bangalore
View GitHub Profile

chartFactory

/affini-tech/ChartFactory

Based on D3.JS and Dimple, ChartFactory provide the ability to build quickly D3.JS charts without coding any lines of javascript. Just define your dashboard in a JSON and voila !

charts: [
        {id:'chart1',
         width:800,height:250,

xAxis:{type:'Category',field: "Month",orderRule:'Date'},

public static String reverseRecursively(String str) {
//base case to handle one char string and empty string
if (str.length() < 2) {
return str;
}
return reverseRecursively(str.substring(1)) + str.charAt(0);
}
@vikitripathi
vikitripathi / onboarding.py
Last active August 29, 2015 14:23
coding game :
import sys, math
# CodinGame planet is being attacked by slimy insectoid aliens.
# <---
# Hint:To protect the planet, you can implement the pseudo-code provided in the statement, below the player.
# game loop
while 1:
enemy1 = raw_input() # name of enemy 1
@vikitripathi
vikitripathi / Notification
Created July 7, 2015 09:59
To notify user of any event use JGrowl : a jquery plugin
<!DOCTYPE html>
<html>
<head>
<title>jGrowl</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.2.12/jquery.jgrowl.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.2.12/jquery.jgrowl.min.js"></script>
<script type="text/javascript">
(function($){
$(function(){
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
@vikitripathi
vikitripathi / launch_sublime_from_terminal.markdown
Created July 27, 2016 08:27 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@vikitripathi
vikitripathi / fetchThingsWithCompletion.m
Created October 3, 2016 12:45 — forked from quellish/fetchThingsWithCompletion.m
Pseudo-sample of a core data fetch with a completion block.
- (void) fetchThingsWithCompletion:(void (^)(NSArray *, NSError *))completion{
[context performBlock:^{
result = [context executeFetch:...
if (completion != nil){
completion(result, error);
}
}];
}
@vikitripathi
vikitripathi / delay.m
Created January 7, 2017 18:11
dispatch_after a delay
- (void)signInWithUsername:(NSString *)username password:(NSString *)password complete:(RWSignInResponse)completeBlock {
double delayInSeconds = 2.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
BOOL success = [username isEqualToString:@"user"] && [password isEqualToString:@"password"];
completeBlock(success);
});
}
@vikitripathi
vikitripathi / install_spark.md
Created February 24, 2017 11:44 — forked from fspaolo/install_spark.md
Install Apache Spark

Install Apache Spark (OSX 10.6)

You need the package manager Homebrew (if not installed), see http://brew.sh/

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Get Spark 'Source Code':

http://spark.apache.org/downloads.html
@vikitripathi
vikitripathi / anorm.scala
Created May 11, 2017 23:23 — forked from davegurnell/anorm.scala
A short guide to Anorm
/*
Overview
--------
To run a query using anorm you need to do three things:
1. Connect to the database (with or without a transaction)
2. Create an instance of `anorm.SqlQuery` using the `SQL` string interpolator
3. Call one of the methods on `SqlQuery` to actually run the query