Skip to content

Instantly share code, notes, and snippets.

View 415DomSmith's full-sized avatar
🎯

Dom 415DomSmith

🎯
  • Target
  • Minneapolis, MN
View GitHub Profile
import ansiStyles from '#ansi-styles';
import supportsColor from '#supports-color';
import { // eslint-disable-line import/order
stringReplaceAll,
stringEncaseCRLFWithFirstIndex,
} from './utilities.js';
@415DomSmith
415DomSmith / usevm.md
Created February 23, 2016 21:01 — forked from fideloper/usevm.md
You should develop in a Virtual Machine

#You should do all your LAMP development in a Virtual Machine

##Here's Why:

Many of us develop on Macintoshes. There are many reasons for this, but one of them is that it's based on a Unix platform of some sort. This allows us to run common server software such as Apache, Ruby, Python and Nodejs on our Macs.

Our computers become powerful develoment machines similar to the servers our apps will eventually live on.

Sometime we start our computer only to find Apache won't start, or MySQL can't create a PID file, or we've updated to Mountain Lion and Apache needs to be reconfigured. Death!

@415DomSmith
415DomSmith / README.md
Created February 17, 2016 22:35 — forked from dergachev/README.md
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@415DomSmith
415DomSmith / gist:a977a20c0a694ca69860
Last active February 8, 2016 17:46
ruby sessions controller
before_action :confirm_logged_in, only: [:home]
before_action :prevent_login_signup, only: [:signup, :login]
def signup
@user = User.new
end
def create
@user = User.create(user_params)
if @user.save
@415DomSmith
415DomSmith / Contract Killer 3.md
Created January 24, 2016 00:09
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

@415DomSmith
415DomSmith / day_one_ruby.rb
Created July 7, 2015 04:55
Answers for Ruby day one problem set
#1) Temperature Convertor
def temp_convert
puts "Type '1' if you would like to convert from Celsius to Fahrenheit \n OR Type '2' to convert from Farenheit to Celsius"
choice = gets.chomp.to_i
if choice == 1
puts "What is your temperature in Celsius?"
cels = gets.chomp.to_i
faren = (cels * (9.0 / 5.0) + 32).round(3)
@415DomSmith
415DomSmith / gist:019b434dd6efc97af90b
Last active August 29, 2015 14:22
Mongo Concepts + Console Exercise Homework
Mongo Concepts + Console Exercise
For tonight's assignment, we'd like you to answer a few questions and define a couple terms as well as write the queries necessary to perform the following tasks. You can either fork and clone this readme or create a new one with your solutions. You will be using the terminal and the mongo shell for this assignment as well as notes/google to answer some of the questions
Part I - Conceptual Review
Define these terms and answer these questions in 1-3 sentences (some will require a bit of googling)
Terms
@415DomSmith
415DomSmith / review questions
Last active August 29, 2015 14:21
Review questions/answers for gSchool's memorial day learning check
**List and describe each of the primitive data types (number, string, boolean, null, undefined). What do they each represent?**
Strings are lines of text wrapped in either double or single quotation marks. Strings as a whole get saved in text, and because of this they are immutable. The original contents of a string can't be changed or modified without creating a new string and a new space in memory.
Numbers can be integers, decimals, or negative numbers. NaN (not a number), and infinity (positive infinity and negative infinity) also fall under the number type in javascript. As a primitive data type, numbers occupy fixed positions in memory.
Booleans have two values, either true or false. The values occupy very little memory in comparison to the other primitive data types.
Null is essentially a place holder for no value or empty value. It is a literal and not a global object(which is one way it differs from undefined) . Null is also tricky when it comes to evaluating equality. For example, null === undefi

Taking your nodebot wifi

Controlling your nodebot using a USB cable is great and all, and obviously you could shell out and grab a sparkcore or some other dedicated controller but what if you've got a standard arduino and you want to take an existing nodebot wireless?

Bluetooth is an option and there's this excellent JohnnyFive wiki entry that will help you there. Bluetooth can be a bit flaky though and it's range is pretty lousy. You can also look at things like XBees and what not using point to point serial, but these are expensive and very fiddly to get working.

Really, what we want is a method of transferring data over a nice, simple, standard method, requiring little configuration, low cost and we can utilise a whole stack of the code we've already produced.

Enter the WiFi232 module. These little beauties are [available from AliExpress for $12 each](http://www.aliexpress.com/item/USR-WIFI232-T-wifi-to-uart-tt