This file contains hidden or 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
class HomeController | |
def download | |
require 'open-uri' | |
require 'fileutils' | |
icons = Icon.all | |
posts = Post.all | |
snapshots = Snapshot.all | |
icons.each do |icon| |
This file contains hidden or 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 data = [ | |
["John", "Doe"], | |
["James", "Brown"] | |
]; | |
function main() { | |
var firstName, lastName; | |
for (var key in data) { | |
firstName = data[key][0]; |
This file contains hidden or 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
// Thanks to http://ctrlq.org/code/19271-html5-speech-input article | |
$(function () { | |
// Check if the user's web browser supports HTML5 Speech Input API | |
if(document.createElement('input').webkitSpeech == undefined) { | |
$(".answer").append("We are sorry but Dictation requires Google Chrome."); | |
} | |
else { |
This file contains hidden or 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
# app/models/ability.rb | |
# All front end users are authorized using this class | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= AdminUser.new | |
case user.role | |
when "admin" |
NewerOlder