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
declare @t table(id int identity primary key, name varchar(20), rv rowversion)
insert into @t (name) values('Moe')
insert into @t (name) values('Larry')
insert into @t (name) values('Curly')
select * from @t order by rv desc;
3 Curly 0x00000000000007EE
2 Larry 0x00000000000007ED
@cbmeeks
cbmeeks / grabbr.js
Created February 12, 2013 19:17
Grabbr Grab the entire friggin' DOM.
(function() {
var grabbr = [];
var walk_the_DOM = function walk(node, func) {
func(node);
node = node.firstChild;
while (node) {
walk(node, func);
node = node.nextSibling;
}
};
@cbmeeks
cbmeeks / KickAss.sublime-build
Created March 1, 2013 01:58
KickAssembler Sublime Text 2 Build System
{
"cmd": ["java -jar ~/bin/KickAss.jar $file_base_name.$file_extension;open $file_base_name.prg"],
"selector": "source.KickAss",
"shell": "true",
"working_dir": "${project_path}"
}
@cbmeeks
cbmeeks / CacheControlFilter.java
Created April 5, 2013 14:23
Generic Cache Control Filter
import java.io.IOException;
import java.util.Date;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
public class CacheControlFilter implements Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
@cbmeeks
cbmeeks / random.sql
Created May 1, 2013 13:25
Generate Random String in MySQL
select substring(md5(rand()) from 1 for 16) as salt
@cbmeeks
cbmeeks / nuke_svn.txt
Created May 2, 2013 14:22
Nuke Subversion
REM CAREFUL!!!!
REM MAKE SURE THIS IS IN THE FOLDER OF YOUR PROJECT AS IT RECUSIVELY NUKES ALL .SVN FOLDERS/FILES
for /d /r . %d in (.svn) do @if exist "%d" rd /s/q "%d"
@cbmeeks
cbmeeks / build.gradle
Created May 23, 2013 13:49
Demo Gradle script
version = '1.0'
apply plugin: 'jetty'
apply plugin: 'eclipse-wtp'
sourceCompatibility = 1.7
sourceSets {
selenium
}
@cbmeeks
cbmeeks / db2_random_id.sql
Created May 29, 2013 20:19
Random string in DB2 (used for ID's)
hex(generate_unique()) as id
@cbmeeks
cbmeeks / st2.txt
Last active December 19, 2015 19:49
Sublime Text 2
** Package Control **
http://wbond.net/sublime_packages/package_control
Soda Theme
https://github.com/buymeasoda/soda-theme
Other Themes
https://github.com/daylerees/colour-schemes
@cbmeeks
cbmeeks / random_str_db2.sql
Created July 26, 2013 14:05
Random String in DB2
select
CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) ||
CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65) ||
CHR( INT(RAND()*26) + 65) || CHR( INT(RAND()*26) + 65)
from SOMETABLE;