Skip to content

Instantly share code, notes, and snippets.

@clouddueling
clouddueling / Browser.php
Last active August 29, 2015 14:15
Browser.php
<?php
$I_Browser = true;
class Browser {
private $_agent = '';
private $_browser_name = '';
private $_version = '';
private $_platform = '';
private $_os = '';
private $_is_aol = false;
<a
class='btn social-facebook btn-large'
href='https://www.facebook.com/sharer.php?s=100&p[title]=<?php echo urlencode($name); ?>&p[url]={{ urlencode(url("{$account->local}/{$meet->local}")) }}&p[summary]={{ urlencode(strip_html_tags($meet->overview)) }}&p[images][0]={{ urlencode(Config::get('aws.s3') . '/' . $meet->image) }}'
target='_blank'>&nbsp;</a>
<a
class='btn social-twitter btn-large'
href='https://twitter.com/share?url={{ urlencode(url("{$account->local}/{$meet->local}")) }}&text={{ urlencode($meet->name) }}'
target='_blank'>&nbsp;</a>
//
// Module Dependencies
// ==================================================================
var auth = require('../lib/auth'),
db = require('../models'),
hash = require('../lib/hash'),
flash = require('../lib/flash');
//
// Controller
@clouddueling
clouddueling / gruntfile.js
Created June 21, 2014 18:04
Comparing similar automation tasks
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-karma');
// set up ======================================================================
// get all the tools we need
var express = require('express');
var app = express();
var port = process.env.PORT || 3001;
var mongoose = require('mongoose');
var passport = require('passport');
var flash = require('connect-flash');
var logger = require('morgan');
@clouddueling
clouddueling / AccountRole.js
Created June 14, 2014 17:33
Through association with SailsJS. Make sure all references to models are lowercase because that is how they're stored.
module.exports = {
tableName: 'account_roles',
attributes: {
account_id: 'integer',
name: 'string',
description: 'text',
deleted: 'boolean',
module.exports = {
tableName: 'account_roles',
attributes: {
account_id: 'integer',
name: 'string',
description: 'text',
deleted: 'boolean',
@clouddueling
clouddueling / UserControllers.js
Created June 12, 2014 22:27
Any suggestions on how to extract the database stuff. Is this fine since it's just an adapter?
module.exports = {
find: function (req, res) {
return User.findOne(req.param('id'))
.exec(function(err, user) {
return res.json({
user: user
});
});
},
var SCALE_FACTOR = 1.2;
self.center = function() {
var activeObject = self.canvas.getActiveObject();
if (activeObject) {
activeObject.center();
activeObject.setCoords();
setUnsaved();
}
};
@clouddueling
clouddueling / gulpfile.js
Created May 30, 2014 03:37
I have a few gulpfiles. One manages my theme in multiple apps and the other manages the app's unique stuff.
// Keeps my theme synced in multiple apps
var gulp = require('gulp');
var gutil = require('gulp-util');
var compass = require('gulp-compass');
var clean = require('gulp-clean');
/*
|--------------------------------------------------------------------------
| Config