This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (C) 2013 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.UnsupportedEncodingException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
public class Md5Util { | |
public static String hex(byte[] array) { | |
StringBuffer sb = new StringBuffer(); | |
for (int i = 0; i < array.length; ++i) { | |
sb.append(Integer.toHexString((array[i] | |
& 0xFF) | 0x100).substring(1,3)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mydb = require('./index.js'); | |
var cloudup = new mydb("https://nio8.cloudup.com", { | |
baseURL: "https://cloudup.com", | |
headers: { | |
"Authorization": "Basic " + (new Buffer([process.env.USERNAME, process.env.PASSWORD].join(':')).toString("base64")), | |
'User-Agent': 'cloudup-local'} | |
}); | |
cloudup.on('connect', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying a Rails App with EC2 + S3 + Ubuntu | |
============================================ | |
Create EC2 Instance | |
------------------- | |
create new instance ami-bf5eb9d6 [http://alestic.com/](http://alestic.com/) | |
create new elastic ip | |
attach elastic ip to instance | |
point dns to elastic ip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
:name => 'name', | |
:title => 'title', | |
:body => 'body' | |
}, | |
{ | |
:name => 'name2', | |
:title => 'title2', | |
:body => 'body2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%- form_for @album do |album_form| -%> | |
<!-- Album Form Stuff --> | |
<%- | |
# file_fields_for is where the magic happens. You supply the association to the model | |
# that has the 'attachment' as well as the property on that model that will receive | |
# the file upload data. This will take care of displaying the necessary upload fields | |
# | |
-%> | |
<%= album_form.attachment_fields_for :photos, :data %> | |
<%- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Timer = function(end, options){ | |
if(!options) options = {}; | |
if(!options['timerInterval']) options['timerInterval'] = 1; | |
if(!options['periods']) options['periods'] = { | |
'milliseconds' : 1, | |
'seconds' : 1000, | |
'minutes' : 60, | |
'hours' : 60, | |
'days' : 24, | |
'weeks' : 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title> | |
Switzerland | |
</title> | |
<meta name="description" content="WE CONCEPT, WE PRODUCE, WE MANAGE. Digital, broadcast, print, outdoor, out of the box, whatever’s right. And we do so in the most compelling, audacious, intriguing, knowledgeable, practiced, insightful, experienced way possible." /> | |
<script type="text/javascript" src="/javascript/jquery-1.3.2.min.js" charset="utf-8"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'shoulda' | |
class WhateverTest < Test::Unit::TestCase | |
should "work" do | |
assert true | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in /Users/bcollins/code/test) | |
past_winners_famewars GET /famewars/past-winners(.:format) {:controller=>"famewars", :action=>"past_winners"} | |
download_famewars GET /famewars/download(.:format) {:controller=>"famewars", :action=>"download"} | |
thanks_famewars GET /famewars/thanks(.:format) {:controller=>"famewars", :action=>"thanks"} | |
famewars GET /famewars(.:format) {:controller=>"famewars", :action=>"index"} | |
POST /famewars(.:format) {:controller=>"famewars", :action=>"create"} | |
new_famewar GET /famewars/new(.:format) {:controller=>"famewars", :action=>"new"} | |
edit_famewar GET /famewars/:id/edit(.:format) {:controller=>"famewars", :action=>"edit"} | |
famewar GET /famewars/:id(.:format) {:controller=>"famewars", :action=>"show"} | |
PUT /famewars/:id(.:format) {:controller=>"famewars", :action=>"update"} |
OlderNewer