Skip to content

Instantly share code, notes, and snippets.

View cbmeeks's full-sized avatar
🏠
Working from home

cbmeeks cbmeeks

🏠
Working from home
View GitHub Profile
/*
* Name: AbstractRepository
* Purpose: To abstract out the Repository interface so that each implementation (ex: UserRepository)
* doesn't have to implement every method.
*
*/
package com.example.dao;
import com.example.struts.utilities.HibernateUtil;
import java.util.ArrayList;
@cbmeeks
cbmeeks / Hotel.xml
Created April 4, 2011 19:59
Sample Hotel
<?xml version="1.0" encoding="utf-8"?>
<Hotel>
<HotelID>1040900</HotelID>
<HotelFileName>Copthorne_Hotel_Aberdeen</HotelFileName>
<HotelName>Copthorne Hotel Aberdeen</HotelName>
<CityID>10</CityID>
<CityFileName>Aberdeen</CityFileName>
<CityName>Aberdeen</CityName>
<CountryCode>GB</CountryCode>
<CountryFileName>United_Kingdom</CountryFileName>
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package getdata;
import java.math.BigDecimal;
import java.util.*;
/**
@cbmeeks
cbmeeks / date.js
Created May 19, 2011 17:20
ExtJS 4
{
name: 'clockOut',
mapping: 'clockOut',
renderer: function(value, id, r) {
var d = new Date(r.data['clockOut']);
return d.format('H:i A');
},
type: 'date'
}
@cbmeeks
cbmeeks / PentahoRedirect.java
Created May 31, 2011 12:16
Pentaho Http Auth
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
// joe:password = Authorization: Basic am9lOnBhc3N3b3Jk
String user = "joe";
String pass = "password";
String headerValue = "Basic " + Base64.encodeString(user + ":" + pass);
response.setHeader("Authorization", headerValue);
ArgumentError in User_sessions#new
Showing app/views/layouts/application.html.erb where line #28 raised:
A copy of ApplicationHelper has been removed from the module tree but is still active!
Extracted source (around line #28):
25: <div class="R"></div>
26: <div class="mid">
27: <div class="mainLinks">
@cbmeeks
cbmeeks / interrupts.asm
Created November 8, 2011 02:30
Samus Aran for Commodore 64
.macro SetupIRQ(line, address) {
sei // disable maskable IRQs
lda #$7f
sta $dc0d // disable timer interrupts which can be generated by the two CIA chips
sta $dd0d // the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
// stop it.
lda $dc0d // by reading this two registers we negate any pending CIA irqs.
@cbmeeks
cbmeeks / scroll.asm
Created November 27, 2011 05:19
scroll.asm
lda $D016
and #%11111000
ora TEMP1
sta $D016
dec TEMP1
bne !exit+
lda #7
sta TEMP1
jsr shiftleft
@cbmeeks
cbmeeks / gist:1443834
Created December 7, 2011 17:57
ShiftLeft
shiftleft:
!draw_right_edge:
lda DBLBUFFER_PTRL // grab the DBLBUFFER_PTR
sta DLBBUFFER_EDGE_PTRL // and add 39 chars
lda DBLBUFFER_PTRH // so that we are on the RIGHT side
sta DLBBUFFER_EDGE_PTRH // of the screen
clc
lda DLBBUFFER_EDGE_PTRL // jump to the RIGHT edge
adc #39
sta DLBBUFFER_EDGE_PTRL
@cbmeeks
cbmeeks / test01.asm
Created December 13, 2011 03:26
Commodore 64 full screen asm scroller
// Imports
.import source "../engine/vars.asm"
.import source "../engine/interrupts.asm"
.import source "../engine/map.asm"
.import source "../engine/misc.asm"
.import source "../engine/screen.asm"
.import source "../engine/sprites.asm"
.var XPIXSHIFT = 4