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
--[[ | |
VPLanguage = lua | |
VPScriptMenuTitle = GitHub Commit | |
VPEndConfig | |
]] | |
-- we assume git is located in /opt/local/bin/git | |
posix.chdir(document:fileName()) | |
-- add new files |
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
class Application < Merb::Controller | |
before :check_remember_me | |
def check_remember_me | |
unless session.authenticated? | |
if cookies[:auth_token] | |
if user = User.first(:auth_token=>cookies[:auth_token]) | |
if user.valid_token? | |
session.user = user | |
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
describe "Facebook Connect Authentication" do | |
it "should create a new user in the system when the Facebook Connect cookies are set" do | |
response = request(url(:home), :cookie=>facebook_cookies) | |
user = User.first(:facebook_id=>facebook_params[:user]) | |
user.should_not be_nil | |
user.should be_valid | |
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
<?php | |
require_once 'PHPUnit/Framework.php'; | |
class Describe_Something_Awesome extends PHPUnit_Framework_TestCase | |
{ | |
public function setUp() | |
{ | |
$this->something = "Awesome!"; | |
} | |
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 | |
$query = "select * from example_table where user_id = ?" | |
$values = array($_SESSION['user_id']); | |
$results = select($query,$values); | |
?> |
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
class MyClass | |
constructor: (options) -> | |
# stuff here | |
myObject = new MyClass(bar: "foo", foo: "bar") |
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
description "Node server for #{application} (#{node_env})" | |
start on (net-device-up | |
and local-filesystems | |
and runlevel [2345]) | |
stop on runlevel [016] | |
script | |
exec sudo -u nobody sh -c "NODE_ENV=#{node_env} #{path_to_node} #{script_name}" | |
end 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
var mysql = some_function_to_create_a_mysql_connection(); | |
app.get('/foo', function (req, res) { | |
mysql.query('SELECT * FROM example', function (err, results) { | |
if(err) { | |
res.send(400); | |
} | |
res.send(results, 200); | |
} |
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 configuration = { | |
domain: 'localhost', | |
port: 3000, | |
keys: require('./keys.js') | |
} | |
var express = require('express'); | |
var app = express(); | |
app.listen(configuration.port); | |
var passport = require('passport'); |
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
-- Function: json_path(json, text) | |
-- DROP FUNCTION json_path(json, text); | |
CREATE OR REPLACE FUNCTION json_path(data json, path text) | |
RETURNS text AS | |
$BODY$ | |
/* JSONPath 0.8.0 - XPath for JSON | |
* | |
* Copyright (c) 2007 Stefan Goessner (goessner.net) |
OlderNewer