Skip to content

Instantly share code, notes, and snippets.

View rboyd's full-sized avatar

Robert Boyd rboyd

  • Bentonville, AR
View GitHub Profile
# Merb SessionCookie unmarshalling with validation against secret key. Useful for 3rd service
# (like socket server) to map cookie -> user_id. Pretty much all of this jacked from Merb
# source and distilled into the same place.
require 'base64' # to convert Marshal.dump to ASCII
require 'openssl' # to generate the HMAC message digest
# Cookies can typically store 4096 bytes.
MAX = 4096
v1 -- squares 1 thru 10
===
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init(event)">
<mx:Canvas width="800" height="600">
<mx:Panel>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
<mx:Canvas id="cnv" />
<mx:Script>
<![CDATA[
[Embed(source="../assets/spritesheet.png")]
private var Sheet:Class;
private static const FRAME_WIDTH:uint = 65;
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
`ls`.split("\n").each { |file|
puts file if file.include? 'gif'
amt = /(\d+).*\.gif/.match(file)[1]
`mv #{amt}top.gif chip#{amt}.gif`
}
using UnityEngine;
using System.Collections;
using System;
using System.IO;
public class TesterScript : MonoBehaviour {
static T GetComp<T>(GameObject go) where T : class {
return go.GetComponent(typeof(T)) as T;
}
scala> <foo thing={bar.map(el => Seq(Text(el)))} />
res9: scala.xml.Elem = <foo thing="bar"></foo>
scala> <foo thing={baz.map(el => Seq(Text(el)))} />
res10: scala.xml.Elem = <foo ></foo>
scala> bar
res11: Some[java.lang.String] = Some(bar)
scala> baz
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.rboyd</groupId>
<artifactId>test4</artifactId>
<version>1.0-SNAPSHOT</version>
<inceptionYear>2008</inceptionYear>
<properties>
<scala.version>2.7.0</scala.version>
</properties>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.3</version>
<packaging>jar</packaging>
</project>
bobby-boyds-macbook-pro:test4 rboyd$ mvn package[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.bluff:test4:jar:1.0-SNAPSHOT
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
Downloading: file://Users/rboyd/work/akka-0.6/embedded-repo/sjson/json/sjson/0.3/sjson-0.3.pom
[INFO] Unable to find resource 'sjson.json:sjson:pom:0.3' in repository project.embedded.module (file://Users/rboyd/work/akka-0.6/embedded-repo)
Downloading: http://scala-tools.org/repo-releases/sjson/json/sjson/0.3/sjson-0.3.pom
[INFO] Unable to find resource 'sjson.json:sjson:pom:0.3' in repository scala-tools.org (http://scala-tools.org/repo-releases)
Downloading: http://repo1.maven.org/maven2/sjson/json/sjson/0.3/sjson-0.3.pom