Skip to content

Instantly share code, notes, and snippets.

View sbleon's full-sized avatar

Leon Miller-Out sbleon

View GitHub Profile
<cfset oneRow = QueryNew('baz')>
<cfset QueryAddRow(oneRow)>
<cfquery name="broken" dbtype="query">
select <cfqueryparam value="1" cfsqltype="cf_sql_integer"> as num, 'a' as letter
from oneRow
union
select <cfqueryparam value="1" cfsqltype="cf_sql_integer"> as num, 'b' as letter
from oneRow
@sbleon
sbleon / gist:dbaf3ad41477010914ebcf0c9234b415
Created May 29, 2018 20:18
Example of broken cffeed Atom output
<cfscript>
theFeed = {
version='atom_1.0',
entry: [
{
content: {
type: 'text/plain',
value: 'Some text'
}
}
@sbleon
sbleon / gist:d84aa407930502439b27c31b3b8da93f
Created July 5, 2016 18:11 — forked from samhocevar/gist:00eec26d9e9988d080ac
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
# Place all this at the beginning of your spec_helper.rb to avoid sending
# incorrect coverage data to Code Climate.
require 'codeclimate-test-reporter'
SimpleCov.start 'rails' do
# We always want to run the HTML coverage formatter.
formatters = [ SimpleCov::Formatter::HTMLFormatter ]
# Code Climate records the first coverage data it is sent for any single
# commit, and then ignores future reports. If you're running a single spec,
# this will result in the reporting of erroneously low test coverage.
@sbleon
sbleon / CMakeLists.txt
Created October 5, 2014 02:25
Update CMakeLists.txt for picam_gpu
cmake_minimum_required(VERSION 2.8)
project( picam )
SET(COMPILE_DEFINITIONS -Werror)
find_package( OpenCV REQUIRED )
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/interface/vcos)
include_directories(/opt/vc/include/interface/vcos/pthreads)
include_directories(/opt/vc/include/interface/vmcs_host/linux)
include_directories(/opt/vc/include/host_applications/linux/libs/bcm_host/include)
link_directories(/opt/vc/lib)
@sbleon
sbleon / open_hangout.scpt
Last active December 24, 2015 00:19
Open a Google Hangout in full-screen mode in Safari
(*
Open a specific Google Hangout in Safari's full-screen mode.
See blog post at http://singlebrook.com/blog/google-hangouts-for-remote-worker-telepresence for more,
including:
- instructions for creating persistent hangouts
- keeping machines in the hangout
leon@singlebrook.com
*)
@sbleon
sbleon / upload_to_cloud_files.rb
Created July 24, 2013 16:17
Upload a large file (> 5GB) to Rackspace Cloud Files
require 'rubygems'
require 'fog'
SEGMENT_LIMIT = 5368709119.0 # 5GB -1
BUFFER_SIZE = 1024 * 1024 # 1MB
CONTAINER = 'my-existing-container'
FILE_DIR = '/path/to/my/big/file'
FILE_NAME = 'huge_tarball.tgz'
RACKSPACE_USERNAME = 'my-rackspace-username'
RACKSPACE_API_KEY = 'my-rackspace-api-key'
@sbleon
sbleon / Intermittent test failure
Created February 21, 2013 16:58
Intermittent test failure in jquery-lazy-images with Poltergeist
1) basic lazy image loading should load the real image only when the user scrolls to it
Failure/Error: page.source.should have_selector 'img[src*="placekitten"]'
expected following output to contain a <img[src*="placekitten"]/> tag:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Dummy</title>
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css">
<script src="/assets/application.js" type="text/javascript"></script>
@sbleon
sbleon / lussh
Created February 19, 2013 02:29
lussh - script to authorize your SSH key on a server
#!/bin/bash
# make sure to run this with /bin/bash, NOT /bin/sh
echo
echo This script will help you setup ssh public key authentication.
host=dummy
@sbleon
sbleon / keeping_server_sw_up_to_date.md
Created October 30, 2012 19:04 — forked from jaredbeck/keeping_server_sw_up_to_date.md
Keeping server software up to date

Keeping Server Software Up To Date

Goals (Why do we upgrade things?)

Primary goal: Improve Security

Secondary goal: More consistency across servers