Skip to content

Instantly share code, notes, and snippets.

View JamesDullaghan's full-sized avatar
🎯
Focusing

James D JamesDullaghan

🎯
Focusing
View GitHub Profile
@JamesDullaghan
JamesDullaghan / Bulletproof_foods.md
Created June 15, 2013 22:41
Dave Aspreys bulletproof diet food list

How many servings should I eat per day?

  • Fruit = 1-2 servings
  • Animal protein = 4 - 6 servings
  • Healthy fats = 5 - 9 servings
  • Healthy vegetables = 6 - 11 servings

How should I allocate my calories per day?

  • Healthy fats = 50%
@JamesDullaghan
JamesDullaghan / Devise_form_helper
Created June 14, 2013 00:58
Devise Sign in form anywhere in app
module HomeHelper
def resource_name
:user
end
def resource
@resource ||= User.new
end
def devise_mapping
@JamesDullaghan
JamesDullaghan / gdal_fail_10_8_3
Created May 26, 2013 00:58
gdal failed to build on 10.8.3
brew doctor
Your system is ready to brew.
brew: superenv removed: -L/usr/local/lib -arch x86_64
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
CPLRecodeIconv(char const*, char const*, char const*) in cpl_recode_iconv.o
CPLRecodeFromWCharIconv(wchar_t const*, char const*, char const*) in cpl_recode_iconv.o
"_iconv_close", referenced from:
CPLRecodeIconv(char const*, char const*, char const*) in cpl_recode_iconv.o
@JamesDullaghan
JamesDullaghan / javascript_notes.mdown
Created May 24, 2013 19:00
Javascript notes from Simon Allardice's Lynda.com class/tutorial

#Javascript Notes

###Core Concepts -

  • HTMl is the markup language - CONTENT ON PAGES
  • CSS is the style sheet language - PRESENTATION ON PAGES
  • JAVASCRIPT is the programming language - BEHAVIOR ON PAGES

Javascript is a programming language. Often times javascript is referred to as a scripting language, but most programmers dismiss this and argue javascript is a programming language.

@JamesDullaghan
JamesDullaghan / Spreadsheet__csvtodb_nil_modules_Schneems.mdown
Created May 8, 2013 18:26
Schneems UT Rails Notes Spreadsheet to db, dealing with nil, modules

#Schneems UT on Rails course notes

  • Spreadsheet to DB
  • Dealing with nil
  • Modules

Spreadsheet to Database - Schneems

We need a csv file

@JamesDullaghan
JamesDullaghan / Rails_tutorial_notes_Chapter_1_to_4.mdown
Created May 5, 2013 20:10
Rails tutorial Notes Chapter 1 - 4

Chapter 1 MVC Architecture

M - Model - Our objects, Its the object oriented approach to design and it encapsulates the data in the database

V - View - Presentation layer - It is what the user sees and interacts with - pages/html/css/javascript

C - Controller - Process and respond to events such as user actions and envoke changes to the model and view based on that. Its going to make decisions for us and control what happens

Conventional => Browser <-> Page <-> Database <=> Page <=> Browser

@JamesDullaghan
JamesDullaghan / ActiveRecord_Schneems_Tutorial_Having.mdown
Created May 5, 2013 19:00
ActiveRecord Schneems Tutorial HAVING notes

#Having#

Objective : Find all of the products that have more than 5 duplicate prices

Group & Having

prods = Product.group(:price).having("count(price) > 5")
puts prods
=> [#<Product id: 1743,

user_id: 1363,

@JamesDullaghan
JamesDullaghan / ActiveRecord_Schneems_Joins_Tutorial_Notes.mdown
Created May 5, 2013 18:55
ActiveRecord Schneems Tutorial Notes on JOINS

#ActiveRecord Schneems tutorial notes#

##Joins##

class Product < ActiveRecord::Base
  belongs_to :user
end

class User < ActiveRecord::Base

has_many :products

@JamesDullaghan
JamesDullaghan / Novation_kbd_launchpad.mdown
Created May 5, 2013 18:32
Novation Launchpad Keyboard shortcuts

#Novation Launchpad for Keyboard shortcuts

###4 Score and 7 years ago, we used keyboard shortcuts, or something...

Something I've always struggled with is remembering keyboard shortcuts. I'm not sure why. Software I grew up using, they have become engrained in memory. I'll never forget the Photoshop 6 shortcuts that became etched in my young impressionable mind. I also dislike using the mouse. It feels so inefficient to move from keyboard to mouse, especially being in flow.

##My brain is too small, helppp!

With the bombardment of great new tools, I've been forced to abandon shortcuts in most applications. This was until my brother showed me a peice of hardware he is using to produce music.

@JamesDullaghan
JamesDullaghan / Fundimentals_Programming_Notes.mdown
Created May 5, 2013 18:29
Fundimentals of programming notes

#Fundtimentals of programming

###What is programming?

  • A computer program is a set of instructions.
  • A sequence of a set of instructions.

The art of programming is to take a larger idea and break it apart into smaller ideas.

Computers will do exactly as you tell them, so you need to make sure your instructions are right.