Skip to content

Instantly share code, notes, and snippets.

View faraz046's full-sized avatar

Faraz Ahmed faraz046

  • Pakistan
View GitHub Profile
@faraz046
faraz046 / jq-checkboxes-status
Created November 2, 2012 14:14
Jquery checkboxes status
//give all the check boxes a class and pass the class name as a string to the function and it will return if any of the checkbox was checked.
function checkboxesstatus(cls) {
var el = $('input.'+cls);
var boxstatus = 0;
el.each(function(){
if($(this).is(':checked')) {
boxstatus++;
}
});
@faraz046
faraz046 / curl_get_file_contents
Created September 24, 2012 06:43
curl file get contents functions
function curl_get_file_contents($URL) {
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
$err = curl_getinfo($c,CURLINFO_HTTP_CODE);
curl_close($c);
if ($contents) return $contents;
else return FALSE;
}
@faraz046
faraz046 / Add app to page
Created September 18, 2012 12:31
Add app to page dialog url
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID
&display=popup&next=YOUR_URL