This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built on pseudo-code from http://en.wikipedia.org/wiki/Mandelbrot_set#Computer_drawings | |
COLORS = %w(1;32 0;32 0;36 1;36 1;37 0;37 1;30 0;30 0;34 1;34 0;35 1;35 0;31 1;31 0;33 1;33) | |
NUM_COLORS = COLORS.length | |
# Detect terminal resolution | |
term_size = `stty size`.split.map { |x| x.to_i }.reverse | |
X_MAX = term_size[0] - 1 | |
Y_MAX = term_size[1] - 3 # Leave room for help text at bottom | |
def print_color_block(color) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Open a new Mac OS X terminal window or tab in the current or another | |
# directory and optionally run a command in the new window or tab. | |
# | |
# - Without any arguments, the new terminal window opens in | |
# the current directory, i.e. the executed command is "cd $PWD". | |
# - If the first argument is a directory, the new terminal will "cd" into | |
# that directory before executing the remaining arguments as command. | |
# - The optional "-t" flag executes the command in a new tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
theFeed = { | |
version='atom_1.0', | |
entry: [ | |
{ | |
content: { | |
type: 'text/plain', | |
value: 'Some text' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
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 | |
*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
NewerOlder