Skip to content

Instantly share code, notes, and snippets.

@waqasy
waqasy / facebook.js
Created October 24, 2015 18:53 — forked from koolay/facebook.js
facebook share
var Share = {};
Share.fb = function (link, title, sumary, image, winWidth, winHeight) {
var shareUrl = 'https://www.facebook.com/dialog/feed?';
shareUrl += 'app_id=141676832590601';
shareUrl += '&link=' + encodeURIComponent(link);
shareUrl += '&picture=' + encodeURIComponent(image);
shareUrl += '&name=' + title;
shareUrl += '&caption=' + "";
shareUrl += '&description=' + sumary;
@waqasy
waqasy / upload2facebook
Created October 24, 2015 16:21 — forked from nseo/upload2facebook
A sample code to upload an image file to facebook using Facebook javascript sdk
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Hello FB</title>
</head>
<body>
<div id="fb-root"></div>
<div id="fb-content"></div>
<div>
@waqasy
waqasy / RGB-Hex.js
Last active August 29, 2015 14:20 — forked from Arahnoid/RGB-Hex.js
///////////////////////////////////////////////////////////////////////////////////
/// Colection of RGB to HSB, HSB to RGB convert functions
/// Source: http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
///////////////////////////////////////////////////////////////////////////////////
/**
* componentToHex convert two digit htx value to R, G or B chanel value
* @param number c value from 0 to 225
* @return string value of R, G or B chanel
* @usage //alert (componentToHex(255)); //ff
// Include Color Thief Script
// https://github.com/lokesh/color-thief
function colorChange(){
//Be sure to include <img id="coverImage" src="" alt=""/>
var $myImage = $("#coverImage");
var colorThief = new ColorThief();
//Grabs 8 swatch color palette from image and sets quality to 5 (0 =slow, 10=default/fast)
var cp = colorThief.getPalette($myImage[0], 8, 5);
(function(){ //Self executing, anonymous function
//Leave out above if including in already existing script
function Swipe(){
var firstX, lastX;
function swipeRight(){
<?php
// http://25labs.com/alternative-for-file_get_contents-using-curl/
function file_get_contents_curl($url, $retries=5)
{
$ua = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
if (extension_loaded('curl') === true)
{