Skip to content

Instantly share code, notes, and snippets.

View sivsivsree's full-sized avatar
👨‍💻
Focusing on Team building

Siv S sivsivsree

👨‍💻
Focusing on Team building
View GitHub Profile
/**
* @author Siv.S
* @date 03/may/2014 at 11:32
*
* convertImgToBase64
* @param {String} url
* @param {Function} callback
* @param {String} [outputFormat='image/png']
* @author HaNdTriX
* @example
@sivsivsree
sivsivsree / get-profile-facebook.php
Last active August 29, 2016 15:39
PHP SDK Version 4.0.0
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;
if($session) {
try {
$user_profile = (new FacebookRequest(
$session, 'GET', '/me'
<?php
require 'tmhOAuth.php'; // Get it from: https://github.com/themattharris/tmhOAuth
// Use the data from http://dev.twitter.com/apps to fill out this info
// notice the slight name difference in the last two items)
$connection = new tmhOAuth(array(
'consumer_key' => '',
'consumer_secret' => '',
'user_token' => '', //access token
@sivsivsree
sivsivsree / postcanvas.js
Created January 20, 2016 09:18 — forked from hnagata/postcanvas.js
Code snippet to post a HTML5 Canvas image to Facebook
/*
* Code snippet to post a HTML5 Canvas image to Facebook
* H. Nagata
*
* Variables:
* accessToken: Facebook access token
* targetID: Posting target id such as user id or album id
* canvas: HTMLCanvasElement
* base64.decode: c.f. https://github.com/hnagata/js-base64
*
package com.sivsivsree.firetest;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
@sivsivsree
sivsivsree / Opensources.html
Created May 5, 2017 08:57
Open Source Libraries Android
Android-ObservableScrollView
https://github.com/ksoichiro/Android-ObservableScrollView
https://github.com/biokys/cropimage
ExoPlayer
--Live audio video Streaming and all
https://github.com/google/ExoPlayer
@sivsivsree
sivsivsree / installMongo.sh
Created August 15, 2018 07:01
Use this gist to install MongoDB Community Edition on LTS Ubuntu Linux systems in one shell script.
if [ ! -f /usr/bin/mongod ]; then
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
else
echo "mongo db already installed. Skipping..."
sudo service mongod stop
sudo apt-get purge mongodb-org*
sudo rm -r /var/log/mongodb
@sivsivsree
sivsivsree / installElasticSearch.sh
Last active August 15, 2018 08:28
Install and Run Elasticsearch
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.deb
sudo dpkg -i elasticsearch-6.3.2.deb
sudo systemctl enable elasticsearch.service
#https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-16-04
# For config and Securing the ES
@sivsivsree
sivsivsree / commands.md
Created September 10, 2018 10:31 — forked from ondrej-kvasnovsky/commands.md
Commands to install and configure ElasticSearch on Ubuntu

Install ElasticSearch and Java

1  wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2  sudo dpkg -i elasticsearch-1.0.1.deb
3  sudo update-rc.d elasticsearch defaults 95 10
4  sudo add-apt-repository ppa:webupd8team/java
5  sudo apt-get update
6  sudo apt-get install oracle-java7-installer
7  java -version
#!/bin/bash
# installing erlang on ubuntu's
VERSION="R15B01"
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev
sudo mkdir -p /opt/erlang/
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl
sudo mv kerl /opt/erlang/