Skip to content

Instantly share code, notes, and snippets.

View codeasashu's full-sized avatar
🌊
Waiting to sail

ashutosh chaudhary codeasashu

🌊
Waiting to sail
View GitHub Profile
<?php
require 'instagram.class.php';
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK'
));
/*
* Copyright (C) 2014 Antonio Leiva Gordillo.
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
package com.example.testchart;
import java.util.*;
import java.io.*;
import java.text.DateFormat;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.*;
// @return [float] a random number between min and max
function getRandom(min, max) {
return Math.random() * (max - min) + min;
}
// @return [integer] a random int between min and max
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
@codeasashu
codeasashu / README.md
Last active August 29, 2015 14:22 — forked from polbins/README.md

Simple RecyclerView Divider

Simple Horizontal Divider Item Decoration for RecyclerView

    mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
            getApplicationContext()
    	));

NOTE: Add item decoration prior to setting the adapter

/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
<?php
// include required files form Facebook SDK
require_once( 'Facebook/HttpClients/FacebookHttpable.php' );
require_once( 'Facebook/HttpClients/FacebookCurl.php' );
require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' );
require_once( 'Facebook/Entities/AccessToken.php' );
require_once( 'Facebook/Entities/SignedRequest.php' );
<?php
// Call set_include_path() as needed to point to your client library.
require_once 'src/Google/Client.php';
require_once 'src/Google/Service/YouTube.php';
session_start();
/*
* You can acquire an OAuth 2.0 client ID and client secret from the
* {{ Google Cloud Console }} <{{ https://cloud.google.com/console }}>
@codeasashu
codeasashu / KillAutoplay.user.js
Created October 3, 2015 13:59 — forked from Sytric/KillAutoplay.user.js
Force turns off autoplay and annotations on all youtube pages (Waits 10sec for page load)
// ==UserScript==
// @name KillAutoplay
// @namespace http://www.sysadminarena.com/ntsk
// @description Turns off annoying Youtube features
// @include /^https?://www\.youtube\.com/.*$/
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @run-at document-end
// @version 2.0.1
// @grant none
// ==/UserScript==
@codeasashu
codeasashu / install_ffmpeg_ubuntu.sh
Created December 13, 2015 23:00 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update