Skip to content

Instantly share code, notes, and snippets.

View typeoneerror's full-sized avatar
🤠
iOS, Capacitor, Ember, Vue, Rails

Benjamin Borowski typeoneerror

🤠
iOS, Capacitor, Ember, Vue, Rails
View GitHub Profile
<?php
function smarty_block_fbml($params, $content, &$smarty, &$repeat)
{
if (!$repeat && !empty($content))
{
$content = trim($content);
$output = <<<EOT
<fb:serverFbml>
<script type="text/fbml">
@typeoneerror
typeoneerror / facebook.dev
Created November 12, 2010 01:01
A snippet of some of the issues I've had so far on a single Facebook dev project. More when it's done.
edge.create events do not fire for comments:
http://github.com/facebook/connect-js/issues/#issue/82
bug with share UI:
Error: Permission denied for <http://static.ak.facebook.com> (document.domain=<http://facebook.com>) to get property Window.Arbiter from <https://www.facebook.com> (document.domain=<https://facebook.com>).
Source File: http://static.ak.facebook.com/connect/canvas_proxy.php#method=resize.ack&params=%7B%7D&relation=parent.frames%5Bf4ffd260f7d5d2%5D
Line: 90
http://forum.developers.facebook.net/viewtopic.php?pid=280935
//die();
require_once "../setup.php";
require_once "bootstrap.php";
require_once "apps.php";
foreach ($apps as $name => $env)
{
$clientId = $env[0];
$appSecret = $env[1];
private View buildIndicator(int imageResource, int stringResource)
{
final Button indicator = (Button)getLayoutInflater().inflate(R.layout.navigation_item, getTabWidget(), false);
indicator.setCompoundDrawables(null, resources.getDrawable(imageResource), null, null); // LTRB
indicator.setText(resources.getString(stringResource));
return indicator;
}
@typeoneerror
typeoneerror / ActivityAsyncTask.java
Created February 9, 2011 09:04
abstract class to run in non-UI thread, and load an XML file into value objects
/*
* Copyright (c) 2011 Typeoneerror Studios LLC
* $Id$
*/
package com.typeoneerror.apps.application.tasks;
import android.util.Log;
import com.typeoneerror.apps.application.io.ActivityFeedHandler;
import com.typeoneerror.apps.application.model.Model;
@typeoneerror
typeoneerror / multilines.m
Created April 21, 2011 01:25
multilines.m
- (void)doTheThing
{
if (TRUE)
[self doSomething];
else
[self doSomethingElse];
NSLog(@"will always run, but looks like part of else");
}
@typeoneerror
typeoneerror / gist:1001461
Created May 31, 2011 22:59
gamekit packets
/** Types of packets sent by session. */
typedef enum {
PacketTypeStart, /**> packet to notify games to start. */
PacketTypeRequestSetup, /**> server wants client info. */
PacketTypeSetup, /**> send client info to server. */
PacketTypeSetupComplete, /**> round trip made for completion. */
PacketTypeTurn, /**> packet to notify game that a turn is up. */
PacketTypeRoll, /**> packet to send roll to players. */
PacketTypeEnd, /**> packet to end game. */
PacketTypeHeartbeat, /**> packet to attempt to keep peers alive. */
@typeoneerror
typeoneerror / gist:1052453
Created June 28, 2011 22:51
decorator hell
/**
* Load the default decorators for forms.
*
* @return Typeoneerror_Form Reference to form instance
*/
public function loadDefaultDecorators()
{
// wipe all
$this->clearDecorators();
@typeoneerror
typeoneerror / environment.rb
Created July 20, 2011 21:25
Hacking in bigint support for Mysql and Postgresql. Got a better method?
# Load the rails application
require File.expand_path('../application', __FILE__)
require 'active_record/connection_adapters/mysql2_adapter'
require 'active_record/connection_adapters/postgresql_adapter'
ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES[:big_primary_key] = "BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY".freeze
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:big_primary_key] = "bigserial primary key".freeze
# Initialize the rails application
@typeoneerror
typeoneerror / .bash_profle
Created July 25, 2011 16:50
.bash_* postgreSQL 9.0 on Mac helpers
function pg_restart
{
echo "Restarting PostgreSQL server..."
sudo su postgres -c "/Library/PostgreSQL/9.0/bin/pg_ctl -wD /Library/PostgreSQL/9.0/data restart"
}
function pg_start
{
echo "Starting PostgreSQL server..."
sudo su postgres -c "/Library/PostgreSQL/9.0/bin/pg_ctl -wD /Library/PostgreSQL/9.0/data start"