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
@cbmeeks
cbmeeks / _mac_glewinit_opengl.cpp
Last active February 11, 2020 21:22
Having trouble calling glewInit() on a Mac? Try this...
// Take a look at the other file below.
// Basically, since OpenGL is a core feature of OSX, you don't need to include GLEW.
/*
So, for example, you can put a conditional include like so:
#ifdef __APPLE__
#include <OpenGL/gl3.h> /// remove the "3" for OpenGL versions < 3
#include <OpenGL/gl3ext.h> /// ditto
@cbmeeks
cbmeeks / sql_server_frag_index.sql
Last active August 29, 2015 14:10
SQL Server Fragmented Indexes
select
i.[object_id],
i.[index_id],
OBJECT_SCHEMA_NAME( i.object_id, DB_ID() ) as SchemaName,
t.[name] as TableName,
i.[name] as IndexName,
(
case i.[fill_factor]
when 0 then 100
else i.fill_factor
@cbmeeks
cbmeeks / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@cbmeeks
cbmeeks / sprites.asm
Last active June 3, 2023 12:08
sprites.asm -- Commodore 64 Sprite Multiplexer
.importonce
//***************************************************************************
// VIC II
// BANK 0: $0000 - $3FFF
// BANK 1: $4000 - $7FFF
// BANK 2: $8000 - $BFFF
// BANK 3: $C000 - $FFFF
//***************************************************************************
@cbmeeks
cbmeeks / jpacontainer.java
Created June 20, 2014 15:25
Vaadin JPA Container Lazy Loading Broke
/**
* <strong>This implementation does not use lazy loading and performs
* <b>extremely</b> bad when the number of items is large! Do not use unless
* you absolutely have to!</strong>
* <p>
* {@inheritDoc }
*/
public int indexOfId(Object itemId) {
/*
* This is intentionally an ugly implementation! This method should not
# LOL!!1
alias wtf='dmesg'
alias onoz='cat /var/log/errors.log'
alias rtfm='man'
alias visible='echo'
alias invisible='cat'
alias moar='more'
@cbmeeks
cbmeeks / Instructions.txt
Created January 8, 2014 13:52
Complete instructions for getting xmllint to work with Sublime Text 2 and Windows.
1) Download XMLLint for Windows here:
https://code.google.com/p/xmllint/downloads/list
2) Choose the xmllint-1.0.exe version and save somewhere in your Windows path (such as your user path).
3) Rename the file to: xmllint.exe (remove the -1.0)
4) Open Sublime Text 2
5) Click Preferences -> Browse Packages (opens up your Packages folder in Windows Explorer).
@cbmeeks
cbmeeks / screen.asm
Created November 29, 2013 06:10
Screen.asm
.importonce
/*
Character memory
$D018 = %xxxx000x -> charmem is at $0000
$D018 = %xxxx001x -> charmem is at $0800
$D018 = %xxxx010x -> charmem is at $1000
$D018 = %xxxx011x -> charmem is at $1800
$D018 = %xxxx100x -> charmem is at $2000
$D018 = %xxxx101x -> charmem is at $2800
@cbmeeks
cbmeeks / screen_shift.asm
Last active December 29, 2015 05:39
Commodore 64 screen shift
copy_screen_left:
:BeginIRQ()
ldx #0
lda SCR_X_POS
beq !loop0+
cmp #1
beq !loop1+
cmp #2
@cbmeeks
cbmeeks / app.js
Last active December 26, 2015 04:29
Samus Aran melonjs
// The Game
var game = {
'onload': function () {
// Initialize video
if (!me.video.init("screen", 640, 480, true, 'auto')) {
alert("Your browser does not support HTML5 canvas.");
return;
}