Skip to content

Instantly share code, notes, and snippets.

View paulomcnally's full-sized avatar
:octocat:
JS

Paulo McNally paulomcnally

:octocat:
JS
View GitHub Profile
@paulomcnally
paulomcnally / demo.php
Created August 3, 2012 06:52
Example IMDB get Thumbnails
<?php
require "imdb.php";
$imdb = new Imdb();
$imdb->setImdbId("tt0021749");
echo $imdb->getThumbnails();
?>
@paulomcnally
paulomcnally / imdb.php
Created August 3, 2012 06:52
Simple Class IMDB
<?php
class Imdb{
private $url = "http://www.imdb.es/title/%s/";
private $imdb_id = NULL;
private $html = NULL;
public function setImdbId( $imdb_id ){
@paulomcnally
paulomcnally / TimeZone.txt
Created August 27, 2012 08:13
List of all Android TimeZone ids
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@paulomcnally
paulomcnally / AndroidNicaraguaRealDate
Created August 27, 2012 08:39
Get real date from Nicaragua - Android
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone( "America/Managua" ));
String now = sdf.format(new Date());
@paulomcnally
paulomcnally / gist:3721429
Created September 14, 2012 11:34
Hex Color Code With Regular Expression
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
@paulomcnally
paulomcnally / gist:3727876
Created September 15, 2012 13:27
MD5 With Regular Expression
/^[0-9a-f]{32}$/i
@paulomcnally
paulomcnally / gist:3727877
Created September 15, 2012 13:27
MD5 With Regular Expression
/^[0-9a-f]{32}$/i
@paulomcnally
paulomcnally / tblTwitterApps.sql
Created October 15, 2012 12:18
tblTwitterApps
CREATE TABLE `tblTwitterApps` (
`app_id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`app_name` VARCHAR(100) NOT NULL,
`app_consumer_key` VARCHAR(100) NOT NULL,
`app_consumer_secret` VARCHAR(100) NOT NULL,
PRIMARY KEY (`app_id`)
)
ENGINE = MyISAM;
@paulomcnally
paulomcnally / tblTwitterAccounts.sql
Created October 15, 2012 12:26
tblTwitterAccounts
CREATE TABLE `tblTwitterAccounts` (
`id` BIGINT(20) UNSIGNED NOT NULL,
`screen_name` VARCHAR(25) NOT NULL,
`oauth_token` VARCHAR(100) NOT NULL,
`oauth_token_secret` VARCHAR(100) NOT NULL,
`app_id` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`id`, `app_id`)
)
ENGINE = MyISAM;
@paulomcnally
paulomcnally / mt_twitter_accounts_add
Created October 15, 2012 14:14
mt_twitter_accounts_add
/**
* @Method mt_twitter_accounts_add
* @Desc Add new twitter account
*/
public function mt_twitter_accounts_add( )
{
$query = "REPLACE INTO tblTwitterAccounts
(
id,
screen_name,