Skip to content

Instantly share code, notes, and snippets.

@tomshaw
tomshaw / app.js
Created August 6, 2011 02:53
A nodemailer wrapper library that makes it easy to send emails using Express and Jade templates.
/*!
* MailWrapper - An extremely simple nodemailer wrapper library that makes it easy to send emails using Express and Jade templates. Originally
* developed to practice and learn how to write modules for node.
*
* Copyright(c) 2011 Tom Shaw <tom@tomshaw.info>
* MIT Licensed
*/
var mailer = require('./lib/mailer');
@rodbegbie
rodbegbie / facebook.py
Created September 3, 2011 00:15
Hacked version of "official" (but now unsupported) Facebook Python SDK to support OAuth 2.0
#!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@ppcano
ppcano / scrollable_view.js
Created November 17, 2011 17:49
ScrollableView using sproutcore-touch
UI.Kit.ScrollableView = SC.CollectionView.extend({
// options
animationDuration: 1000,
easing: "easeOutExpo",
// must be set ( pixels available) to provide elastic scroll
scrollableHeight: 0,
// options elastic
@moraes
moraes / gist:2370781
Created April 12, 2012 20:32
GetPage for App Engine datastore (Go)
package foo
import (
"reflect"
"appengine"
"appengine/datastore"
)
var (
@mandrasch
mandrasch / directive.js
Created April 26, 2012 10:55
JqueryFileUpload Directive (Beware quick & dirty!)
/* jqueryFileUpload-Plugin
https://github.com/blueimp/jQuery-File-Upload */
MYANGULARAPP.directive('myJqueryfileupload', function(){
return{
restrict:'E',
compile:function(el,attrs){
var compiler = this;
var elem = el;
// 2DO: serialize it from json?
@coopernurse
coopernurse / calc.coffee
Created June 24, 2012 00:06
Barrister RPC + angularjs + coffeescript
#
# generic Barrister transport - can be used with any endpoint
#
angularTrans = (url, $http) ->
return (req, callback) ->
reqJson = Barrister.JSON_stringify(req)
post = $http.post url, reqJson
post.success (data, status, headers, config) ->
callback data
post.error (data, status, headers, config) ->
@enjalot
enjalot / hook.coffee
Last active December 20, 2015 05:58
derby server side hooks (to hold you over for now)
#make a hook
store.hook 'change', 'collection.*.foo', (docId, value, op, session, backend) ->
model = store.createModel()
#logic
#setup the hook method
store.hook = (method, pattern, fn) ->
store.shareClient.use 'after submit', (shareRequest, next) ->
{opData} = shareRequest
ALLOWED_COLLECTIONS = [
'auths' # Private user data
]
store.allow 'create', 'auths', (docId, newDoc, session) ->
console.log '[Auths] CREATE'
undefined
store.allow 'all', 'auths.*', (docId, relPath, opData, docBeingUpdated, session) ->
console.log '[Auths] CHANGE'
@vmakhaev
vmakhaev / access.js
Created December 23, 2013 03:26
Idea of new racer-access api
var racerAccess = require('racer-access');
derby.use(racerAccess);
var store = derby.createStore();
// This is current racer-access api
store.allow('change', 'users', function(docName, changeTo, snapshotData, connectSession) {
return;
});
@pinscript
pinscript / home.html
Last active September 23, 2017 01:18
{{define "body"}}
This is the start page.
<br><br>
Check out <a href="/user/5">user 5</a> or <a href="/user/7">user 7</a>.
{{end}}