Skip to content

Instantly share code, notes, and snippets.

View codeimpossible's full-sized avatar
🍕
P I Z Z A

Jared Barboza codeimpossible

🍕
P I Z Z A
View GitHub Profile
@codeimpossible
codeimpossible / tilelayer.cs
Created May 5, 2014 19:16
ERMAH GERD WHY NO GIZMOS?!?!?!
[ExecuteInEditMode]
public class TileLayer : MonoBehaviour
{
public Vector2 LayerSize;
public Vector2 CellSize;
public Color GridColor;
public bool DrawGridLines;
public bool DrawPaintbrushGuide;

Keybase proof

I hereby claim:

  • I am codeimpossible on github.
  • I am codeimpossible (https://keybase.io/codeimpossible) on keybase.
  • I have a public key whose fingerprint is AEB9 81B3 8416 24B7 0CCB 27AA 091E 348F D8F9 61E9

To claim this, I am signing this object:

@codeimpossible
codeimpossible / WithTry.cs
Created March 18, 2014 05:57
A really odd DSL around try/catch in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
namespace WithTrySample
{
public class WithTryResult<T>
{
@codeimpossible
codeimpossible / extensions.cs
Created March 18, 2014 05:53
Some c# extension methods I wrote a really long time ago...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace CodeImpossible.Core
{
/// <summary>
/// Object extension methods
public override void RenderContent(DataContext dataContext)
{
// Note: Given the framework/tech, I don't have full control over all of this. Maybe I should refactor?
var dataItem = GetDataItem(dataContext);
// If we're right-aligned, either set a new data item or don't do anything
if (IsRightAligned)
{
var rightAlignedDataItem = GetRightAlignedDataItem(dataContext, currentItemDetails, mediaList);
if (rightAlignedDataItem != null)
@codeimpossible
codeimpossible / Actor.cs
Last active December 30, 2015 10:49
PlayerController from a unity game I am making.
using System;
using UnityEngine;
namespace FragCastle.GameObjects
{
public class Actor : MonoBehaviour
{
private const string HorizontalAxis = "Horizontal";
private Animator _animator;
#
# An improvement on http://stackoverflow.com/a/9094206/284612
#
# Place this file in spec/support/signed_cookies.rb
#
module SignedCookies
def signed_cookie(name, opts={})
verifier = ActiveSupport::MessageVerifier.new(request.env["action_dispatch.secret_token".freeze])
if opts[:value]
@request.cookies[name] = verifier.generate(opts[:value])
/*!
* Bootstrap Responsive v2.3.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
@codeimpossible
codeimpossible / index.html
Last active December 23, 2015 06:19 — forked from anonymous/jsbin.IXALOP.css
new frag castle website design... rough draft
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap.js"></script>
<link href='http://fonts.googleapis.com/css?family=Iceland' rel='stylesheet' type='text/css'>
@codeimpossible
codeimpossible / gist:6231746
Created August 14, 2013 14:46
blog comment reply
var collection = [1,2,3,"4",5];
var current = -1;
for( var len = collection.length; ++current <= len; ) {
// do stuff
}