Skip to content

Instantly share code, notes, and snippets.

View sumardi's full-sized avatar
🏠
Working from home

Sumardi Shukor sumardi

🏠
Working from home
View GitHub Profile
@rcoup
rcoup / aws_usage.py
Created June 1, 2010 21:46
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@ErikEvenson
ErikEvenson / .gitignore
Created March 12, 2011 22:40
Xcode 4 .gitignore file
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3
@mheap
mheap / oauth.php
Last active August 30, 2021 09:24
Example of using PECL's OAuth for PHP
<?php session_start();
define('OAUTH_CONSUMER_KEY', '');
define('OAUTH_CONSUMER_SECRET', '');
define('OAUTH_REQUEST_URL', 'https://api.twitter.com/oauth/request_token');
define('OAUTH_ACCESS_URL', 'https://api.twitter.com/oauth/access_token');
define('OAUTH_AUTHORISE_URL', 'https://api.twitter.com/oauth/authorize');
define('API_URL','http://api.twitter.com/1/');
@xslim
xslim / ItemParser.h
Created June 11, 2011 17:19
NSXMLParser + CoreData Sample
#import <Foundation/Foundation.h>
#import "Item.h" // Core Data MO
// Synchronous parser ! Will lock thread !
@interface ItemParser : NSObject <NSXMLParserDelegate>
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext; // MOC for newly created MO
@property (nonatomic, retain) Item *currentItem;
@lukaszkorecki
lukaszkorecki / Readme.markdown
Created June 21, 2011 17:36
How to upload files using JSOAuth and FormData

Compatibility

Works in Mikrob which is deployed both to Titanium Desktop and as a Chrome Application.

This code was extracted from my own code and a wrapper library which I'm working on.

Any questions? Post them in comments.

Behind the scenes

Here's where everything happens:

@slywalker
slywalker / bootstrap_form.php
Created October 6, 2011 05:15
form helper for CakePHP on twitter bootstrap
<?php
class BootstrapFormHelper extends AppHelper {
public $helpers = array('Html', 'Form');
public function input($name, $options = array()) {
$default = array(
'type' => null,
'label' => null,
'before' => null, // to convert .input-prepend
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@twobitlabs
twobitlabs / NSURLConnection+Timeout.m
Created April 30, 2012 17:55
Synchronous NSURLConnection timeout
@implementation NSURLConnection (Timeout)
+ (dispatch_queue_t)timeoutLockQueue {
static dispatch_queue_t queue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
queue = dispatch_queue_create("timeout lock queue", DISPATCH_QUEUE_SERIAL);
});
return queue;
}
@raphaelstolt
raphaelstolt / php54_php53_pear_macports.markdown
Created May 17, 2012 21:37
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules