Skip to content

Instantly share code, notes, and snippets.

View devgeeks's full-sized avatar

tommy-carlos williams devgeeks

View GitHub Profile
@devgeeks
devgeeks / LICENSE
Created August 8, 2011 01:21
Eventarc javascript inline event list
Eventarc PHP API Library License Agreement
This license is a legal agreement between you and Eventarc for the use of the Eventarc PHP API Library (the "Software"). By obtaining the Software you agree to comply with the terms and conditions of this license.
Copyright (c) 2009-2011 Eventarc
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
@devgeeks
devgeeks / ReadItLaterFull.m
Created April 12, 2012 04:32
change to ReadItLaterFull.m
// ADD THIS...
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
// JUST ABOVE THIS... (NEAR THE BOTTOM OF THE FILE)
-(void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
@devgeeks
devgeeks / gist:2934680
Created June 15, 2012 04:35
Attempted Harp.ui panel toggling button
$('.btn.closex').bind('tap',function(){
panel.close();
$(this).removeClass('closex').addClass('openx');
});
$('.btn.openx').bind('tap',function(e){
panel.open({direction:'right'});
$(this).removeClass('openx').addClass('closex');
});
@devgeeks
devgeeks / GoodURIDesign.md
Created August 23, 2012 07:41
Good URI design

Stolen from Bob Aman's excellent answer on Stack Overflow

General principles for good URI design:

  • Don't use query parameters to alter state
  • Don't use mixed-case paths if you can help it; lowercase is best
  • Don't use implementation-specific extensions in your URIs (.php, .py, .pl, etc.)
  • Don't fall into RPC with your URIs
  • Do limit your URI space as much as possible
  • Do keep path segments short
@devgeeks
devgeeks / bugherd-config-api-rfc.md
Created October 19, 2012 01:44
RFC - BugHerd Configuration API

This is a request for comment - this is a proposed configuration API for the BugHerd Public Feedback and Sidebar

The BugHerd sidebar can be configured to override some of its default behaviour as well as display extra information in any tasks that you pass in from a configuration object called BugHerdConfig.

When setting up BugHerd for the first time, you probably already know you need to add the following code to your site:

  <script type="text/javascript">
    (function (d, t) {
      var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
@devgeeks
devgeeks / meta-data-config.md
Created November 23, 2012 00:00
BugHerd meta data configuration API

The BugHerd sidebar can be configured to override some of its default behaviour as well as display extra information in any tasks that you pass in from a configuration object called BugHerdConfig.

When setting up BugHerd for the first time, you probably already know you need to add the following code to your site:

  <script type="text/javascript">
    (function (d, t) {
      var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
      bh.type = 'text/javascript';
      bh.src = '//www.bugherd.com/sidebarv2.js?apikey=YOUR-API-KEY-HERE';
@devgeeks
devgeeks / s3-phonegap-upload.js
Created November 27, 2012 19:47
S3 direct upload
var options = new FileUploadOptions();
options.fileKey="fileupload";
var time = new Date().getTime();
var userId = getUserId(); // In my case, Parse.User.current().id;
var fileName = userId+"-"+time+".jpg";
options.fileName = fileName;
options.mimeType ="image/jpeg";
options.chunkedMode = false;
var uri = encodeURI("https://BUCKET_NAME.s3.amazonaws.com/");
@devgeeks
devgeeks / generate-policy.rb
Created November 28, 2012 05:11
S3 direct upload policy generator
require 'base64'
require 'openssl'
require 'digest/sha1'
policy_document = '{"expiration": "2015-01-01T00:00:00Z",
"conditions": [
{"bucket": "BUCKET_NAME_HERE"},
["starts-with", "$key", "FOLDER_NAME_HERE/"],
{"acl": "public-read"},
["starts-with", "$Content-Type", "image/"],
@devgeeks
devgeeks / raised-tabbar-snippet.m
Created December 2, 2012 09:23
Snippet needed to add a raised TabBar button in PhoneGap to the TabBar or NativeControls plugin on iOS
UIImage* buttonImage = [UIImage imageNamed:@"aperture-tab.png"];
UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height);
[button setBackgroundImage:buttonImage forState:UIControlStateNormal];
[button setBackgroundImage:buttonImage forState:UIControlStateHighlighted];
CGFloat heightDifference = buttonImage.size.height - tabBar.frame.size.height;
CGPoint center = tabBar.center;
@devgeeks
devgeeks / gist:4600088
Created January 22, 2013 23:53
A two second hack fix for the menusheet extension allowing scrolling of the entire container when open
// Hax fix for container scrolling while menusheet is open.
$('#jqt').on('scroll', function (e) {
// Snap back if not after about the half way point...
if (this.scrollLeft < ($(window).width() / 4)) {
this.scrollLeft = 0;
}
// Or close if it is...
else {
$('#menusheet').menusheet('hide');
}