Skip to content

Instantly share code, notes, and snippets.

View porimol's full-sized avatar
🎯
Focusing

Porimol Chandro porimol

🎯
Focusing
  • Warsaw, Poland
View GitHub Profile
@porimol
porimol / List.md
Last active August 29, 2015 14:14 — forked from msurguy/List.md

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@porimol
porimol / evenodd.c
Last active August 29, 2015 14:20
Print Even and Odd Number in C Programming
/*
* File: evenodd.c
* Name: P.C Roy
* Date: 06-05-2015
*/
#include <stdio.h>
/*
* define main function
* return type int
@porimol
porimol / calculator.c
Last active August 29, 2015 14:20
Console base calculator
/*
* File : calculator.c
* Program By : P.C Roy
* Date : 08-05-2015
*/
// call to the header file
# include <stdio.h>
// main function
int main()
@porimol
porimol / distance.c
Last active August 29, 2015 14:20
Problem : Find out s = ut+1/2at^2
/*
* file name : distance.c
* date : 08-05-2015
* solved by : P.C ROY
*/
// call to library file
#include <stdio.h>
// declare the main function
@porimol
porimol / problem1.c
Last active August 29, 2015 14:20
Mathematical Problem
/*
* File : problem1.c
* Program By : P.C Roy
* Date : 08-05-2015
*/
// call to the header file
#include <stdio.h>
// main function
int main()
{
@porimol
porimol / cgpa.c
Created May 13, 2015 19:09
CGPA calculation of our first semester. Batch CSE - 32/D
/*
* File : cgpa.c
* Program By : P.C Roy
* Date : 14-05-2015 12.50AM
*/
// call to the header file
#include <stdio.h>
// main function
int main()
{
@porimol
porimol / country_name_with_iso.php
Created June 2, 2015 18:19
232 Countries Name, Dialer Prefix and ISO Information
<?php
$countries = array();
$countries[] = array("iso_code"=>"AF","country_name"=>"Afghanistan","country_code"=>"93");
$countries[] = array("iso_code"=>"AL","country_name"=>"Albania","country_code"=>"355");
$countries[] = array("iso_code"=>"DZ","country_name"=>"Algeria","country_code"=>"213");
$countries[] = array("iso_code"=>"AS","country_name"=>"American Samoa","country_code"=>"1");
$countries[] = array("iso_code"=>"AD","country_name"=>"Andorra","country_code"=>"376");
$countries[] = array("iso_code"=>"AO","country_name"=>"Angola","country_code"=>"244");
$countries[] = array("iso_code"=>"AI","country_name"=>"Anguilla","country_code"=>"1");
$countries[] = array("iso_code"=>"AG","country_name"=>"Antigua","country_code"=>"1");
@porimol
porimol / envato-screenshots-downloader.php
Created November 21, 2015 17:01 — forked from hasinhayder/envato-screenshots-downloader.php
Download large preview images from the envato item's screenshots page
#!/usr/bin/env php
<?php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
set_time_limit(0);
$dir = $argv[1];
$source = $argv[2];
print_r($argv);
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';
@porimol
porimol / gist:49fd864ef2ac5797cefc
Created December 22, 2015 09:38 — 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

@porimol
porimol / top_likers.py
Created March 6, 2016 06:57 — forked from masnun/top_likers.py
Facebook Top Likers
import facebook
from collections import Counter
import requests
likes_counter = Counter()
# Get temp tokens at: https://developers.facebook.com/tools/explorer/
USER_ACCESS_TOKEN = ""
client = facebook.GraphAPI(access_token=USER_ACCESS_TOKEN, version='2.5')