Skip to content

Instantly share code, notes, and snippets.

Adam Tuttle atuttle

View GitHub Profile
@atuttle
atuttle / Makefile
Last active Mar 25, 2020
A quick makefile for setting up Folding@Home on OSX
View Makefile
# https://hub.docker.com/r/linuxserver/foldingathome/
up: .setup
docker start foldingathome
open:
open http://localhost:7396/
down:
docker stop foldingathome
@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 / 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, '' );
View someReactComponent.js
var store = require('store') //my redux store
var unsubscribe
var MyComponent = React.createClass({
componentDidMount: function componentDidMount(){
unsubscribe = store.subscribe(function handleStateChange(){
// in ES6 we could do this: this.forceUpdate()
// but what is the solution for ES<6?
})
}
@atuttle
atuttle / .gitconfig
Created Mar 9, 2016
My ~/.gitconfig (with sensitive portions removed)
View .gitconfig
[color]
ui = auto
[core]
autocrlf = input
excludesfile = /Users/atcodes/.gitignore_global
[push]
default = tracking
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr,%an)%Creset' --abbrev-commit --date=relative
st = status -sb
@atuttle
atuttle / approach_a.cfc
Last active Jan 18, 2016
Which way is better? Why?
View approach_a.cfc
var messageStatus = new util.iQuery("
select
status
from
Message
where
messageId = :id
",{
id: { cfsqltype: "cf_sql_numeric", value: batch.messageId[1] }
});
@atuttle
atuttle / .jscsrc
Created Jul 1, 2015
My JSCS config and a sample of how it formats
View .jscsrc
{
"preset": "node-style-guide"
,"validateIndentation": "\t"
,"disallowAnonymousFunctions": true
,"disallowSpacesInsideParentheses": { "only": [ "{", "}" ] }
,"requireSpacesInsideParentheses": { "all": true, "except": [ "{", "}" ]
,"requireSpacesInsideBrackets": { "allExcept": [ "[", "]", "{", "}" ] }}
,"requireSpacesInsideObjectBrackets": "allButNested"
,"validateParameterSeparator": ", "
,"disallowCommaBeforeLineBreak": true
You can’t perform that action at this time.