Skip to content

Instantly share code, notes, and snippets.

Adam Tuttle atuttle

Block or report user

Report or block atuttle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@atuttle
atuttle / leeroy.cfg
Created Oct 20, 2011
This is my preseed file for auto-installing Ubuntu 11.04 on my Jenkins server
View leeroy.cfg
#### Contents of the preconfiguration file (for squeeze)
### Localization
# Preseeding only locale sets language, country and locale.
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
#d-i localechooser/supported-locales en_US.UTF-8, nl_NL.UTF-8
d-i debian-installer/locale string en_US
@atuttle
atuttle / Amazon S3 Upload.cfm
Created Jan 28, 2013
Upload files to Amazon S3 with ColdFusion. This is heavily based on code from Joe Danziger's s3.cfc: http://amazons3.riaforge.org/
View Amazon S3 Upload.cfm
<cffunction name="uploadToAmazonS3">
<cfargument name="fileName" required="true" />
<cfargument name="contentType" required="true" />
<cfargument name="data" required="true" />
<cfargument name="acl" default="public-read" />
<cfargument name="storageClass" default="STANDARD" />
<cfargument name="HTTPtimeout" default="300" />
<cfargument name="bucket" default="#getProperty('EmailAttachmentS3Bucket')#" />
<cfargument name="accessKeyId" default="#getProperty('EmailAttachmentS3AccessKeyId')#" />
<cfargument name="secretKey" default="#getProperty('EmailAttachmentS3SecretKey')#" />
@atuttle
atuttle / timezones.cfm
Last active Dec 7, 2018
Dealing with Time Zones in ColdFusion
View timezones.cfm
<!---
Many thanks to Sean Corfield and Ryan Guill who set me down the correct path of java.util.TimeZone
--->
<cfscript>
writeDump(label="Conversion Examples",var={
"0-local-tz": getSystemTZ()
,"1-local-now": now()
,"2-utc-now": toUTC(now())
,"3-eastern-now": TZtoTZ( getSystemTZ(), now(), "America/New_York" )
@atuttle
atuttle / _readme.md
Last active Oct 1, 2018
Push Packt Free Book of the Day alert into your slack channel
View _readme.md

Push alerts about the daily 🆓 Packt eBook into Slack

Install this globally. Yes, globally.

$ npm install -g scrape-html

Now create a local project somewhere:

@atuttle
atuttle / artist.cfm
Created Mar 25, 2011
An example of writing REST web services in ColdFusion, without a framework. This code is provided as an example of a simple implementation, but should not be considered a best practice or something I am promoting. I use this in one of my presentations as
View artist.cfm
<!---
An example of writing REST web services in ColdFusion, without a framework (and why you should use one).
Provided as an example of a simple implementation, but should not be considered a best practice or something
I am promoting. Not thoroughly tested, not very maintainable, not even that reusable.
--->
<cfsetting enablecfoutputonly="true" showdebugoutput="false" />
<cffunction name="StructKeyRequire" output="false">
<cfargument name="s" type="struct" />
@atuttle
atuttle / api.js
Created Feb 4, 2014
Angular.js REST API Service Wrapper
View api.js
app.factory('API', function($http, $q){
var basePath = 'http://domain.com/api/path';
// => http://domain.com/api/path/foo/bar
function makeRequest(verb, uri, data){
var defer = $q.defer();
verb = verb.toLowerCase();
//start with the uri
@atuttle
atuttle / Gruntfile.js
Created Jun 10, 2016
My Browserify & Grunt config for React.js with LESSCSS
View Gruntfile.js
module.exports = function(grunt){
'use strict';
grunt.initConfig({
less: {
bundle: {
options: {
compress: true
,report: 'min'
View deORM.cfm
<cfscript>
function deORM( obj, depth = 1, depthLimit = 10 ){
var deWormed = {};
if (depth >= depthLimit){
return {};
}
if (isSimpleValue( obj )){
deWormed = obj;
}
else if (isObject( obj )){
@atuttle
atuttle / Cobalt2.spTheme
Created Apr 25, 2016
Cobalt2 theme (ported from the Sublime Text theme by @wesbos) for Sequel Pro: http://www.sequelpro.com/ -- save it as Cobalt2.spTheme and import it from your settings.
View Cobalt2.spTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
@atuttle
atuttle / EOL.cfm
Created Apr 18, 2016
Determining what char codes ACF uses on different operating systems
View EOL.cfm
<cfscript>
fn = "ram://eol.txt";
f = fileOpen( fn, "append", "utf-8" );
fileWriteLine( f, '1' );
fileWriteLine( f, '2' );
fileClose( f );
r = fileRead( fn );
chars = listToArray( r, '' );
You can’t perform that action at this time.