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
node_modules/ | |
*.sw* |
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 Model < ActiveRecord::Base | |
attr_accessible :date | |
def self.find_by_week(week, year) | |
dates = Date.commercial(year,week)..Date.commercial(year,week+1) | |
Model.where :date => dates.take(7) | |
end | |
end |
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
# encoding: utf-8 | |
def words = %w[Berg Hügel Tal Ebene] |
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
RewriteEngine On | |
RewriteBase / | |
# ensure the browser supports gzip encoding | |
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b | |
RewriteCond %{REQUEST_FILENAME}.gz -s | |
RewriteRule ^(.+) $1.gz [L] | |
# ensure correct Content-Type and add encoding header | |
<FilesMatch \.css\.gz$> |
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
Name: ControlV | |
Version: 0.1 | |
Synopsis: yet another pasteboard | |
Description: A demo pasteboard intended to show off happstack-foundation | |
Homepage: http://www.happstack.com/ | |
License: BSD3 | |
License-file: LICENSE | |
Author: Jeremy Shaw | |
Maintainer: [email protected] | |
Category: Happstack |
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
vboOfList :: Int -> [Float] -> IO BufferObject | |
vboOfList size elems = | |
let ptrsize = toEnum $ size * 4 | |
arrayType = ElementArrayBuffer | |
in do | |
[array] <- genObjectNames 1 | |
bindBuffer arrayType $= Just array | |
arr <- newListArray (0, size - 1) elems | |
withStorableArray arr (\ptr -> bufferData arrayType $= (ptrsize, ptr, StaticDraw)) | |
bindBuffer ArrayBuffer $= Nothing |
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
CREATE TRIGGER updated AFTER UPDATE ON users | |
FOR EACH ROW BEGIN | |
UPDATE users SET `updated`=CURRENT_TIMESTAMP WHERE id=NEW.id; | |
END; |
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 | |
class Application_Form_NewUser extends Twitter_Bootstrap_Form_Horizontal | |
{ | |
public function init() | |
{ | |
$this->setMethod('post'); | |
$this->setName('newUserForm'); | |
$this->addElement('text', 'email', array( |
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.configure(functon() { | |
app.use(express.cookieParser()); | |
app.use(express.session({secret: 'Fluttershy is best Pony'})); | |
var passport = require('passport'); | |
app.use(passport.initialize()); | |
app.use(passport.session()); | |
}); |
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 passport = require('passport'), | |
TwitterStrategy = require('passport-twitter').Strategy, | |
GoogleStrategy = require('passport-google-oauth').Strategy, | |
users = require('./model').users; | |
/* | |
This is for serializing a user object. | |
Basically, it should return all of an user object | |
that is necessary to identify it. Usually, the id | |
field will do just fine. |