Skip to content

Instantly share code, notes, and snippets.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
@adrianlee
adrianlee / dnode-auth.js
Created February 3, 2012 07:28 — forked from tanepiper/dnode-auth.js
Mongoose Authentication
// Authentication middleware
// -------------------------
// Shim for DNode's current version of socket.io,
// which cannot pass `null` references, and turning
// the mongoose model to a pure JSON object
function shim(err, doc, fn) {
if (!err) err = 0
if (doc) doc = JSON.parse(JSON.stringify(doc))
git clone https://github.com/miksago/jade-tmbundle
git clone https://github.com/LearnBoost/stylus.git
~/Downloads/
Create directories:
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
cd ~/.config/sublime-text-2/Packages/
cp -rf ~/.config/sublime-text-2/Packages/Jade.tmbundle ./Jade/
cp -rf ~/.config/sublime-text-2/Packages/Stylus.tmbundle ./Stylus/
/*
GET /profile -> index
GET /profile/new -> new
POST /profile -> create
GET /profile/:id -> show
GET /profile/:id/edit -> edit
PUT /profile/:id -> update
DELETE /profile/:id -> destroy
*/
Searching 2906 files for "BBX"
D:\git\BB10-WebWorks-Framework\build\build.js:
22 function _done(error) {
23 if (error) {
24: util.puts("BBX-Framework BUILD FAILED:\n" + error);
25 process.exit(1);
26 } else {
27: util.puts("BBX-Framework BUILD SUCCESS");
28 process.exit();
@adrianlee
adrianlee / gist:2726785
Created May 18, 2012 18:06
webworks framework issue 85 bootstrap index.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, target-densitydpi=device-dpi, width=device-width">
<title>JNEXT PPS TEST</title>
<script>qnx.callExtensionMethod('webview.setEnableWebInspector', 1, true);</script>
<script>
window.testNS = {
windowGroup : -1,
@adrianlee
adrianlee / a.js
Created June 21, 2012 04:45
testing an object which is shared between all instances of the current module and made accessible through require()
var b = require('./b');
var b2 = require('./b');
console.log(b.test());
console.log(b2.test());
console.log("-----");
b.omg();
console.log(b.test());
console.log(b2.test());
/**
* @toc {Data Storage} HTML5 Web Notification
* @namespace This Notification API provides functionality to display notifications to users.
*/
HTMLNotification = {
/**
* @function
* @constructedBy window.webkitNotifications
* @description Creates a new notification object.
Avaliable whitelist functions:
isAccessAllowed()checks if <access uri="*" /> or !!getAccessByUrl() is true
getFeaturesForUrl() gets an array of features that are whitelisted for the URL.
Scenario:
Assume we want to check if http://rim.com is whitelisted for blackberry.io feature. We don't know if there is global access.
assume getFeaturesForUrl() returns [ "blackberry.app" ]
isAccessAllowed() may return true but we don't know if it is because there's global access or because !!getFeaturesForURL() is true.
@adrianlee
adrianlee / gist:3037668
Created July 3, 2012 04:16
node session read/write
var io = require('socket.io'),
express = require('express');
var app = express.createServer(),
socket = io.listen(app),
store = new express.session.MemoryStore;
app.use(express.cookieParser());
app.use(express.session({ secret: 'something', store: store }));