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
<?php | |
class Arrays{ | |
/** | |
* Sample $obj = Users::all(); | |
* @param Object(Eloquent) $obj | |
* Key usage for assoc with value in the array $data | |
* @param string $key | |
* Value usage for fill array $data | |
* @param string $value | |
* Enable first element |
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
# config/initializers/omniauth.rb | |
module OmniAuth | |
module Strategies | |
# tell OmniAuth to load our strategy | |
autoload :Pixelation, 'lib/pixelation_strategy' | |
end | |
end | |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :twitter, "app_name", "secret" |
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
<?php | |
class MY_Controller extends CI_Controller | |
{ | |
#public $layout = 'default'; | |
public $title = 'Unesc - Universidade do Extremo Sul Catarinense'; | |
public $css = array('application','libs/blueprint/screen', | |
'libs/jquery-ui-1.8.16.custom','libs/ui.notify'); | |
public $js = array('libs/modernizr-2.0.6', | |
'libs/jquery-1.6.2.min', 'libs/jquery-ui-1.8.16.custom.min', |
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
// division-by-zero-test.js | |
var vows = require('vows'), | |
assert = require('assert'), | |
tobi = require('tobi'), | |
auth = require('basic-auth') | |
var suite = vows.describe('Server NowJS') | |
, now = new Date().getTime() |
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
<?php | |
include_once dirname(__FILE__) . '/spec_helper.php'; | |
include_once APPPATH . '/workers/resize_image_job.php'; | |
require_once 'PHPSpec/Mocks/Functions.php'; | |
use \Mockery as m; | |
class DescribeResizeImageJob extends \PHPSpec\Context | |
{ |
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
{ | |
"author": "", | |
"name": "basi-auth", | |
"description": "Simple HTTP Basic Authentication", | |
"version": "0.0.1", | |
"repository": { | |
"url": "" | |
}, | |
"main": "./basic-auth", | |
"engines": { |
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
<!--- container to hold notifications, and default templates ---> | |
<div id="container" style="display:inline"> | |
<div id="sticky"> | |
<a class="ui-notify-close ui-notify-cross" href="#">x</a> | |
<h1>#{title}</h1> | |
<p>#{text}</p> | |
</div> | |
</div> |
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> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="utf-8"> | |
<title>{title_for_layout}</title> | |
{css_for_layout} | |
{js_for_layout} | |
<!--[if lt IE 8]><link rel="stylesheet" href="assets/css/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]--> | |
</head> | |
<body> |
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 url = 'http://localhost/codeigniter-academic/assets/images/photos/'; | |
// with NowJs | |
$(document).ready(function(){ | |
// JQuery notify | |
$container = $("#container").notify(); | |
//Channel to emit notify | |
now.notify = function(title, message){ | |
$("#container").notify("create", "sticky", { |
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
// middleware basic authentication | |
exports.basicAuth = function(req, res, next) { | |
if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) { | |
// Get the username and password | |
var header = new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString(); | |
header = header.split(":"); | |
var username = header[0]; | |
var password = header[1]; | |
//console.log(request.headers.authorization); |