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
# 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 / 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
@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 / 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 / custom.css
Created December 23, 2014 14:52
Static button using Materialize
.right-buttons {
bottom: 0;
margin-bottom: 20px;
position: fixed;
right: 0;
}
@cbmeeks
cbmeeks / vga.spin
Created March 28, 2015 03:07
VGA Driver
''********************************************
''* VGA 128x96 64-Color Bitmap Driver v1.0 *
''* Author: Andy Schenk *
''* See end of file for terms of use. *
''********************************************
''* based on Chip Gracey's 512x384 Bitmap driver
''
'' This object generates a 128x96 pixel bitmap, signaled as 1024x768 VGA.
'' Each pixel is one byte, so the entire bitmap requires 12 kbytes,
'' Pixel memory is arranged left-to-right then top-to-bottom.
@cbmeeks
cbmeeks / swapGH.js
Created July 9, 2015 13:21
Swap the README.md and file list in GitHub repos
$('#readme').insertBefore('.file-navigation');
# how to save a record
# console...
key = "your key"
secret = "your secret"
# Chattanooga lat/lon = 35.0456297 / -85.3096801
client = Simplegeo.new( key, secret, "yourlayer" )
records = Simplegeo::Records.new( client )
<% title '<script language="javascript">alert("See, this works");</script>' %>
class ThirdpartyController < ApplicationController
before_filter :authenticate_user!
before_filter :get_consumer_info, :except => [ :index ]
def index
session[:request_token] = nil
end
def tripit
gem 'oauth'