Skip to content

Instantly share code, notes, and snippets.

View vivekrk's full-sized avatar
🎯
Focusing

Vivek Kundapur vivekrk

🎯
Focusing
View GitHub Profile
@vivekrk
vivekrk / introrx.md
Created February 28, 2018 17:11 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package java.net;
import java.io.IOException;
import java.io.InputStream;
import java.security.Permission;
@vivekrk
vivekrk / User.js
Created March 13, 2017 04:29
User.js
attributes: { ‘
firstname’: { 
type: ‘string’,
 required: true 
},
 ‘lastname’: { 
type: ‘string’ 
},
 ‘email’: { 
type: ‘email’,
@vivekrk
vivekrk / git.migrate
Created October 1, 2016 05:41 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@vivekrk
vivekrk / build_android.sh
Last active August 29, 2015 14:07
FFMPEG Android build script
#!/bin/bash
echo " _ __ _ __ _ "
echo " | | / / (_) / /_ ____ _ ____ ___ (_) ___ "
echo " | | / / / / / __/ / __ \/ / __ __ \ / / / __ \ "
echo " | |/ / / / / /_ / /_/ / / / / / / / / / / /_/ / "
echo " |___/ /_/ \__/ \____/ /_/ /_/ /_/ /_/ \____/ "
echo " "
# export ANDROID_NDK=
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
@vivekrk
vivekrk / Expiry.java
Last active August 29, 2015 14:06
Hard coded expiry
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
NotificationManager.getInstance().addObserver(loginSucess.name(), this);
if (isExpired()) {
AlertDialog alertDialog = new AlertDialog.Builder(this)
.setTitle("Expired")
.setCancelable(false)
.setMessage("This Build has expired!")
// THIS IS A BETA! I DON'T RECOMMEND USING IT IN PRODUCTION CODE JUST YET
/*
* Copyright 2012 Roman Nurik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@vivekrk
vivekrk / timer.js
Created October 19, 2012 15:06
A simple timer sample in javascript
function Timer () {
var i = 1;
var timer = setInterval(function() {
console.log(i);
i++;
if(i > 10) {
clearInterval(timer);
}
}, 1000);
}