This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Featured Image Support for Wodpress Theme | |
* @author Ali Haris (@iharis) (http://gist.github.com/harisdozz) | |
* @since 1349163394 | |
*/ | |
/** | |
* Add the following to theme functions.php to enable the core-function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* clearfix hack */ | |
.clearfix:after { | |
visibility: hidden; | |
display: block; | |
font-size: 0; | |
content: " "; | |
clear: both; | |
height: 0; | |
} | |
.clearfix { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get YouTube Embed URL | |
* @author Ali Haris (cyberatoll.com) | |
*/ | |
/** | |
* @param url | |
* @return youtube embed url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* stdio.h | |
Definitions for stream input/output. | |
Copyright (c) Borland International 1987,1988,1990,1991 | |
All Rights Reserved. | |
*/ | |
#ifndef __STDIO_H | |
#define __STDIO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** 2/12/2012 | |
** Ali Haris | |
*/ | |
/* | |
This is a js which identifies | |
the viewport width and assigns | |
to the websites container. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Scanner; | |
/** | |
* Fibonacci Number Generator | |
* @author haris | |
*/ | |
public class Fibonacci { | |
public static void main(String args[]) { | |
/** Initialize the scanner */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* OrderedBehavior | |
* | |
* @developer Alexander Morland ( aka. alkemann) | |
* @license MIT | |
* @version 2.1 | |
* @modified 27. august 2008 | |
* | |
* This behavior lets you order items in a very similar way to the tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function formatTelephoneNo($phone_number, $country_code = false) | |
{ | |
$cleaned = preg_replace('/[^[:digit:]]/', '', $phone_number); | |
if ($country_code) { | |
preg_match('/(\d{3})(\d{3})(\d{4})/', $cleaned, $matches); | |
return "({$matches[1]}) {$matches[2]} {$matches[3]}"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACAccountStore *accountStore = [[ACAccountStore alloc] init]; | |
ACAccountType *facebookAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; | |
id options = @{ | |
ACFacebookAppIdKey: @"403376439767549", | |
ACFacebookPermissionsKey: @[ @"email", @"read_friendlists"], | |
ACFacebookAudienceKey: ACFacebookAudienceFriends | |
}; | |
[accountStore requestAccessToAccountsWithType:facebookAccountType | |
options:options | |
completion:^(BOOL granted, NSError *error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDate *dateTraded = [NSDate dateWithTimeIntervalSince1970:1408636621]; | |
NSDateFormatter *_formatter=[[NSDateFormatter alloc]init]; | |
[_formatter setLocale:[NSLocale currentLocale]]; | |
[_formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; | |
NSString *_date=[_formatter stringFromDate:dateTraded]; | |
NSLog(@"Final time: %@", _date); |
OlderNewer