Skip to content

Instantly share code, notes, and snippets.

@wesleyhales
wesleyhales / ChatServerServletContextListener.java
Created January 21, 2012 03:16
Blog: CDI Event Based Development with WebSockets and JBoss AS7
private Server server = null;
/**
* Start Embedding Jetty server when WEB Application is started.
*
*/
public void contextInitialized(ServletContextEvent event) {
try {
// 1) Create a Jetty server with the 8081 port.
InetAddress addr = InetAddress.getLocalHost();
this.server = new Server();
@wesleyhales
wesleyhales / gist:1901427
Created February 24, 2012 14:52
settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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
@wesleyhales
wesleyhales / LinkedList.js
Created March 12, 2012 19:02
JavaScript LinkedList Example
//I wanted a more elegant linkedlist example than the others, so purely for academic purposes I created one.
var LinkedList = function(e){
var that = {}, first, last;
that.push = function(value){
var node = new Node(value);
if(first == null){
first = last = node;
@wesleyhales
wesleyhales / common.css
Created April 7, 2012 22:54
common.css
.clearlink {
background: url(images/close-button.png) no-repeat scroll 0 0 transparent;
background-position: center center;
cursor: pointer;
/*zoom: 1;*/
position: absolute;
right: 0.25em;
top: 50%;
margin: 1px;
height: 12px;
(function (window, undefined) {
"use strict";
/**
* @class asynchronous resource loader
*/
var CNNLoader = (function () {
var init = function (options) {
options = options || {};
},
@wesleyhales
wesleyhales / confess-mod.js
Created July 26, 2012 20:52
phantom script
var fs = require('fs');
var confess = {
run: function () {
var cliConfig = {};
confess.performancecache = this.clone(confess.performance);
if (!this.processArgs(cliConfig, [
{
name: 'url',
def: 'http://google.com',
{
"task": "performance",
"userAgent": "chrome",
"userAgentAliases": {
"iphone": "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7",
"android": "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"chrome": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.12 Safari/535.11"
},
"wait": 0,
"cacheWait" : 200,
@wesleyhales
wesleyhales / skia.debugger.steps
Created February 18, 2013 20:25
Notes for building the Skia Debugger on OSX 10.7.5.
Download QT 4.8: http://qt-project.org/downloads
Follow quickstart: https://sites.google.com/site/skiadocs/user-documentation/quick-start-guides/mac
prerequisites, chekout, build, run tests
Checkout and build SKIA Debugger
https://sites.google.com/site/skiadocs/developer-documentation/skia-debugger
I had a few problems building and kept getting strange compile errors. I waited one day and updated the code with svn up and it magically started building.
GYP_DEFINES="skia_os=mac skia_arch_width=64" make debugger
Checkout and build Chromium
<section class="slide-group">
<section class="slide" data-option="master">
<h3 class="send">What is your favorite color?</h3>
</section>
<section class="slide" data-option="Blue">
<div class="send">
Blue is the one of the three additive primary colours..
</div>
// Last commit: 7575f5a (2013-03-05 03:49:07 -0800)
(function() {
window.DS = Ember.Namespace.create({
// this one goes past 11
CURRENT_API_REVISION: 12
});
})();