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
!!! 5 | |
%html | |
%head | |
%title Sinatra AWS Upload Example | |
%link{:rel => "stylesheet", :href => "/css/swfupload.css", :type => "text/css", :media => "all"} | |
%link{:rel => "stylesheet", :href => "http://cachedcommons.org/cache/blueprint/0.9.1/stylesheets/screen-min.css", :type => "text/css", :media =>"all"} | |
%script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"} | |
%body | |
= yield |
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 'sinatra' | |
require 'active_support/core_ext' | |
require "base64" | |
get '/upload' do | |
bucket = 'bucket name here' | |
access_key_id = 'access key id here' | |
secret_access_key = 'Enter secret access key here' |
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
<?xml version="1.0"?> | |
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> | |
<cross-domain-policy> | |
<allow-access-from domain="*" secure="false" /> | |
</cross-domain-policy> |
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
irb(main):004:0> Teacher.find_by_id(49) | |
Teacher Load (0.3ms) SELECT "teachers".* FROM "teachers" WHERE "teachers"."id" = 49 LIMIT 1 | |
=> #<Teacher id: 49, name: "Sam Rice", bio: nil, email: nil, created_at: "2011-06-22 21:03:41", updated_at: "2011-06-22 21:03:41", pic_file_name: nil, pic_content_type: nil, pic_file_size: nil, pic_updated_at: nil> | |
irb(main):007:0> Teacher.find_by_name("Sam Rice") | |
Teacher Load (0.3ms) SELECT "teachers".* FROM "teachers" WHERE "teachers"."name" = 'Sam Rice' LIMIT 1 | |
=> nil |
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
// ==UserScript== | |
// @name Hype Machine direct download links v3 | |
// @author tonyskn_at_gmail.com and wayne@blissofbeing.com | |
// @description Add download links next to tracks on The Hype Machine. | |
// @include http://hypem.com/* | |
// ==/UserScript== | |
// Modified by @blissofbeing | |
// Fixed jQuery conflict issue | |
// Modified by @obmas | |
// I got rid of the hot keys and the embeded icon. This now adds (Download) next to the track and attributes to work with the DownThemAll plugin. |
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
(jQuery), function (a) { | |
a.fn.autosaveField = function (b) { | |
var c = a.extend({}, a.fn.autosaveField.defaults, b); | |
return this.each(function () { | |
var b = a(this); | |
if (b.data("autosaved-init")) return; | |
var d = b.attr("data-field-type") || ":text", | |
e = b.find(d), | |
f = b.attr("data-action"), | |
g = b.attr("data-name"), |
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
DOM: | |
<div ng-repeat="post in posts"> | |
... | |
abbr.created-at.arial.timeago title="{{post.created_at}}" | |
</div> | |
Script: | |
.directive('postTile', function($timeout){ |
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
angular.module('hyveServices', ['ngResource']). | |
factory('HyvePost', function($resource){ | |
return $resource('/hyves/'+gon.current_hyve.id+'/posts/:id', {}, { | |
update: { method: 'PUT'}, | |
query: {method: 'GET', isArray:true} | |
}); | |
}).factory('Comment', function($resource){ | |
return $resource('/posts/:post_id', {}, { | |
update: { method: 'PUT'}, | |
query: {method: 'GET', isArray:true} |
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
"SELECT \"worksheets\".* FROM \"worksheets\" INNER JOIN \"plans\" ON \"plans\".\"id\" = \"worksheets\".\"plan_id\" WHERE \"plan\".\"student_id\" IS NULL" |
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
# Downloads server | |
server { | |
listen 80; | |
server_name files.domain.com; | |
root /some/path/files.domain; | |
location /downloads { | |
secure_link $arg_md5,$arg_expires; | |
secure_link_md5 "$secure_link_expires$uri DOWNLOAD_SECRET"; |
OlderNewer