Skip to content

Instantly share code, notes, and snippets.

View v1shwa's full-sized avatar
:octocat:
⚡️

Vishwa v1shwa

:octocat:
⚡️
View GitHub Profile
@v1shwa
v1shwa / README.md
Created February 26, 2018 02:38 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


# Copyright (c) 2013 Georgios Gousios
# MIT-licensed
# Edited to handle two new tables: postLinks and tags that are present in the 2014 dataset
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use stackoverflow;
create table badges (
Id INT NOT NULL PRIMARY KEY,
@v1shwa
v1shwa / get-social-shares
Created April 14, 2016 06:12 — forked from ihorvorotnov/get-social-shares
Get number of shares from social platforms
Facebook*:
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
+ works, returns shares, likes, comments and total
Twitter:
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
+ v1 API but still works
Reddit:
http://buttons.reddit.com/button_info.json?url=%%URL%%
@v1shwa
v1shwa / gist:f7bbdc234bdc5df0ed0c8eadb9e19d48
Created April 3, 2016 05:19 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@v1shwa
v1shwa / foo.log
Created February 12, 2016 16:15 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred
@v1shwa
v1shwa / PHP - excel to array helper function.php
Last active December 5, 2015 11:54 — forked from calvinchoy/PHP - excel to array helper function.php
PHP - excel to array helper function
<?php
/*
|--------------------------------------------------------------------------
| Excel To Array
|--------------------------------------------------------------------------
| Helper function to convert excel sheet to key value array
| Input: path to excel file, set wether excel first row are headers
| Dependencies: PHPExcel.php include needed
*/
function excelToArray($filePath, $header=true){