Skip to content

Instantly share code, notes, and snippets.

View Sophrinix's full-sized avatar

Andrew McElroy Sophrinix

View GitHub Profile
@Sophrinix
Sophrinix / ActionController::UnknownHttpMethod
Created March 27, 2012 01:53
TIL about ActionController::UnknownHttpMethod
Started POST "/users/sign_in" for 192.168.1.7 at 2012-03-26 22:42:26 -0500
Processing by Devise::SessionsController#create as URL_ENCODED_FORM
Parameters: {"username"=>"user@example.com", "password"=>"[FILTERED]"}
Completed 401 Unauthorized in 1ms
[2012-03-26 13:48:17] ERROR ActionController::UnknownHttpMethod: put, accepted HTTP methods are OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, VERSION-CONTROL, REPORT, CHECKOUT, CHECKIN, UNCHECKOUT, MKWORKSPACE, UPDATE, LABEL, MERGE, BASELINE-CONTROL, MKACTIVITY, ORDERPATCH, ACL, SEARCH, and PATCH
@Sophrinix
Sophrinix / gist:4325168
Created December 18, 2012 05:00
On Ubuntu 12.04 HOW TO FIX major opcode of failed request: 154 (GLX)
If you have this error message:
glxinfo
name of display: :0.0
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 154 (GLX)
@Sophrinix
Sophrinix / web.config
Created January 19, 2013 05:51
a known working web.config for IIS 7.5 HTTP verbs are explicitly listed. This uses FCGI through rack on ruby 1.9.3p194 64 bit.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<heliconZoo>
<!-- These settings are applied when IIS application pool uses 32-bit CPU mode -->
<application name="rails.project">
<environmentVariables>
<add name="HOME" value="%APPL_PHYSICAL_PATH%" />
<add name="GEM_HOME" value="&quot;%APPL_PHYSICAL_PATH%\vendor\gems\ruby\1.9.1\&quot;" />
var circle = Titanium.UI.createView({
height:200,
width:200,
borderRadius:50,
backgroundColor:'#336699',
top:10,
left:50
});
currentWindow.add(circle);
@Sophrinix
Sophrinix / output on second run of simulator FugitiveRow.js
Last active December 19, 2015 07:48
duplicate model objects in allow
[INFO] : iPhone Simulator log:
[INFO] : {"__iamalloy":true,"__views":{"row":{"className":"loc_row","id":"row","horizontalWrap":true,"dataId":"","model":"c30b8d57-860c-6355-a38c-e56e6a7815cf"},"__alloyId8":{"id":"__alloyId8","layout":"vertical","horizontalWrap":true,"height":"SIZE"},"name":{"text":"Nolan Wright","left":"5dp","id":"name","horizontalWrap":true,"color":"#000","right":"5dp","top":"2dp","height":"SIZE","font":{"fontSize":"24dp"}},"address":{"id":"address","horizontalWrap":true,"font":{"fontSize":"20dp"},"color":"#000"}},"row":{"className":"loc_row","id":"row","horizontalWrap":true,"dataId":"","model":"c30b8d57-860c-6355-a38c-e56e6a7815cf"},"__alloyId8":{"id":"__alloyId8","layout":"vertical","horizontalWrap":true,"height":"SIZE"},"name":{"text":"Nolan Wright","left":"5dp","id":"name","horizontalWrap":true,"color":"#000","right":"5dp","top":"2dp","height":"SIZE","font":{"fontSize":"24dp"}},"address":{"id":"address","horizontalWrap":true,"font":{"fontSize":"20dp"},"color":"#000"}}
[INFO] : {"__i
@Sophrinix
Sophrinix / convertImages.sh
Last active December 21, 2015 07:38 — forked from bob-sims/convertImages.sh
This will be updated for alloy. If I don't finish this by 23rd of August, first person to spot that I haven't updated this for alloy gets a free beer on me at the next titanium themed conference.
#! /bin/bash
# inspired by Greg McCormick's (@crushmedianet) post
# http://crushmedia.net/2012/04/23/automated-build-of-titanium-iconloading-files/
# updated 4 Aug 2012: creates clipped iPad backgrounds by cropping 768x1024, etc.
# create following base images + save in APPNAME/Resources/:
# appicon-android-512x512.png
#! /bin/bash
# inspired by Greg McCormick's (@crushmedianet) post
# http://crushmedia.net/2012/04/23/automated-build-of-titanium-iconloading-files/
# updated 4 Aug 2012: creates clipped iPad backgrounds by cropping 768x1024, etc.
# create following base images + save in APPNAME/Resources/:
# appicon-android-512x512.png
#! /bin/bash
# inspired by Greg McCormick's (@crushmedianet) post
# http://crushmedia.net/2012/04/23/automated-build-of-titanium-iconloading-files/
# updated 4 Aug 2012: creates clipped iPad backgrounds by cropping 768x1024, etc.
# create following base images + save in APPNAME/Resources/:
# appicon-android-512x512.png
@Sophrinix
Sophrinix / gist:6396850
Created August 31, 2013 08:01
UITableViewCellEditingStyleInsert in titanium mobile as styleInsert
// Allows customization of the editingStyle for a particular cell located at 'indexPath'. If not implemented, all editable cells will have UITableViewCellEditingStyleDelete set for them when the table has editing property set to YES.
- (UITableViewCellEditingStyle)tableView:(UITableView *)ourTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
RETURN_IF_SEARCH_TABLE_VIEW(UITableViewCellEditingStyleNone);
TiUITableViewRowProxy *row = [self rowForIndexPath:indexPath];
//Yes, this looks similar to canEdit, but here we need to make the distinction between moving and editing.
//Actually, it's easier than that. editable or editing causes this to default true. Otherwise, it's the editable flag.
if ([TiUtils boolValue:[row valueForKey:@"editable"] def:editable || editing])
{
@Sophrinix
Sophrinix / gist:6448649
Created September 5, 2013 10:51
an example of AndroidManifest.xml which makes your app a launcher.
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>