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
<?php | |
use Aws\Common\Aws; | |
use Aws\S3\Exception\S3Exception; | |
// make sure the SDK is installed | |
// I've used Composer to autoload it: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html | |
/* | |
* jQuery File Upload Plugin PHP Class 7.1.0 | |
* https://github.com/blueimp/jQuery-File-Upload |
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
require 'sinatra' | |
require 'haml' | |
$users = {'john' => {:roles => [:user] }, 'mike' => {:roles => [:user, :admin] } } | |
$tokens = {'123' => {:username => 'john', :expires_at => Time.now+60}} | |
helpers do | |
def authenticate_user! | |
@auth_token = auth_token | |
if $tokens.has_key?(@auth_token) && !$tokens[@auth_token][:expires_at].nil? && $tokens[@auth_token][:expires_at] > Time.now |
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
/** | |
* Module dependencies | |
*/ | |
var express = require('express'); | |
var fs = require('fs'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// img path |
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
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
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
-- ---------------------------------------------------------------------------------------------------- | |
-- Stored Procedures for querying GFTS data from the State of Delaware in a MySQL database. | |
-- | |
-- Copyright 2010 Mark J. Headd | |
-- http://www.voiceingov.org | |
-- | |
-- This file is free software; you can redistribute it and/or modify it under the terms of the | |
-- GNU Library General Public License as published by the Free Software Foundation; either version 2 of the | |
-- License, or (at your option) any later version. | |
-- This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
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
-- ------------------------------------------------------------------------------------------------------- | |
-- A SQL script for importing GFTS data from the State of Delaware into a MySQL database. | |
-- | |
-- Copyright 2010 Mark J. Headd | |
-- http://www.voiceingov.org | |
-- | |
-- This file is free software; you can redistribute it and/or modify it under the terms of the | |
-- GNU Library General Public License as published by the Free Software Foundation; either version 2 of the | |
-- License, or (at your option) any later version. | |
-- This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |