Skip to content

Instantly share code, notes, and snippets.

View melvinmt's full-sized avatar

Melvin Tercan melvinmt

  • San Francisco / Los Angeles
View GitHub Profile
<?php
require_once('phpFlickr.php');
$f = new phpFlickr($flickr_api_key, $flickr_api_secret);
$f->auth("read");
?>
<?php
// first, save medium image
$ch = curl_init($medium['source']);
$medium_local_path = UPLOAD_DIR.'/'.time().'_'.basename($medium['source']);
$parse = parse_url($medium_local_path);
$medium_local_path = $parse['path']; // clean up dirty query strings from file name
$fh = fopen($medium_local_path, "w");
<?php
require_once('phpFlickr.php');
$f = new phpFlickr($flickr_api_key, $flickr_api_secret);
$request = $f->people_getPhotos($user_id);
foreach ($request['photos']['photo'] as $photo){
<?php
require_once('phpFlickr.php');
$f = new phpFlickr($flickr_api_key, $flickr_api_secret);
$request = $f->photos_getSizes($photo['id']);
// assume that largest size comes last:
$large = $request[count($request)-1];
@melvinmt
melvinmt / HttpClient.php
Created November 4, 2011 18:55
Tinypay POST method fix
<?php
/*
* Mashape PHP Client library.
*
* Copyright (C) 2011 Mashape, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@melvinmt
melvinmt / gist:3140173
Created July 19, 2012 01:30 — forked from idan/gist:3135754
Re: A Sample Post

This is me quoting this.

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@melvinmt
melvinmt / learngo.go
Created September 4, 2013 17:26
Code from http://learnxinyminutes.com/docs/go/ formatted with gofmt
// Single line comment
/* Multi-
line comment */
// A package clause starts every source file.
// Main is a special name declaring an executable rather than a library.
package main
// Import declaration declares library packages referenced in this file.
def is_prime(x):
if x < 2:
return False
if x == 2:
return True
if x % 2 == 0:
return False
i = 3
while i < x:
if x % i == 0: