Skip to content

Instantly share code, notes, and snippets.

View vividvilla's full-sized avatar

Vivek R vividvilla

View GitHub Profile
@vividvilla
vividvilla / js
Last active August 29, 2015 14:11
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script>
if (!window.jQuery) {
document.write('<script src="js/jquery-1.11.1.min.js"><\/script>');
}
if(!window.angular) {
document.write('<script src="js/angular.min.js"><\/script>');
}
// Intercepting HTTP calls with AngularJS.
angular.module('MyApp', [])
.config(function ($provide, $httpProvider) {
// Intercept http calls.
$provide.factory('MyHttpInterceptor', function ($q) {
return {
// On request success
request: function (config) {
// console.log(config); // Contains the data about the request before it is sent.
@vividvilla
vividvilla / sample-json.json
Last active August 29, 2015 14:15
Sample json output format
[
{
"bookmarks":24,
"views":47561,
"link":"/community/businessobjects-design-studio/blog/2014/05/29/design-studio-1213-sdk--design-studio-utility-pack",
"likes":28,
"title":"Design Studio 1.2/1.3 SDK - Design Studio Utility Pack"
},
{
"bookmarks":3,
http://blogsearch.google.com/ping/RPC2
http://1470.net/api/ping
http://api.feedster.com/ping
http://api.moreover.com/RPC2
http://api.moreover.com/ping
http://api.my.yahoo.com/RPC2
http://api.my.yahoo.com/rss/ping
http://bblog.com/ping.php
http://blog.goo.ne.jp/XMLRPC
http://blogdb.jp/xmlrpc
@vividvilla
vividvilla / LED Fading Effect using Arduino
Last active December 10, 2015 10:38
LED Fading Effect using Arduino – just like your Sleeping Mac - http://www.electronicsblog.org/led-fading-effect-using-arduino/
const int LED = 9;
int i = 0;
void setup()
{
pinMode(LED, OUTPUT);
}
void loop()
{
@vividvilla
vividvilla / ad-widget-genesis.php
Last active December 11, 2015 15:08
How Show up Banner Ads below Primary Menu on Genesis Child Themes - http://www.wpstuffs.com/banner-ads-below-menu-on-genesis-child-themes
/** Register Topads widget area */
genesis_register_sidebar( array(
'id' => 'topads',
'name' => __( 'topads', 'custom-theme' ),
'description' => __( 'Here you can place 720*90 Ad', 'custom-theme' ),
) );
/** Add topads widget after the primary menu */
/* Java Program to print first N terms of Fibonacci series using Recursive function (without taking input from user)
* Code by Vivek R (vividvilla) - Contact me at - http://vivek.techiestuffs.com
*/
public class FibonacciRecursive
{
public static void main(String[] args)
{
int n=10,i,j=0;
System.out.println("Printing first "+n+" numbers in Fibonacci Series \n");
//Program to find the type of operating system 32bit or 64 bit
#include<stdio.h>
void findit(char s[]) // Function which accepts array of characters(String)
{
int a=sizeof(s); // Finding the size of s[] which is a pointer
if(a==4) // checking whether a is 4byte
printf(" 32bit system\n");
@vividvilla
vividvilla / social-icons.html
Last active December 12, 2015 05:18
How to place a social media icons with hover effect on WordPress – Without Plugin
<div class="social-media-icons">
<a class="social-header">Let's be Friends</a>
<a href="http://facebook.com/wpstuffs" target="_blank" rel="nofollow" title="Facebook" class="socialfb">Facebook</a>
<a href="https://twitter.com/wp_stuffs/" target="_blank" rel="nofollow" title="Twitter" class="socialtw">Twitter</a>
<a href="https://plus.google.com/u/0/b/111632665869439509422/111632665869439509422" target="_blank" rel="nofollow" title="Google Plus" class="socialgp">Google Plus</a>
@vividvilla
vividvilla / social-icons.css
Last active December 12, 2015 05:19
CSS for placing social media icons on WordPress sidebar
.social-media-icons
{
background-color: none;
width:100%;
height:80px;
}
.social-header
{
padding:0px 10px 2px 10px;