Skip to content

Instantly share code, notes, and snippets.

View mcconkiee's full-sized avatar

Eric McConkie mcconkiee

View GitHub Profile
@mcconkiee
mcconkiee / project.sh
Created October 22, 2019 22:12
Typescript quick setup
# https://dev.to/theghostyced/setting-up-a-node-typescript-project-in-under-4-minutes-4gk2
npm init -y
# ts config
touch tsconfig.json
echo '{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"rootDir": "src",
"outDir": "dist",
# REACT NATIVE
## recreate bundle js
```
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
```
## Add host file
### EMULATOR
```
@mcconkiee
mcconkiee / keybase.md
Last active November 15, 2017 19:06
keybase.md

Keybase proof

I hereby claim:

  • I am mcconkiee on github.
  • I am mcconkie (https://keybase.io/mcconkie) on keybase.
  • I have a public key whose fingerprint is 9B1A CB2C 61DF 3B54 7528 CDB8 F538 A7E1 EEB3 880D

To claim this, I am signing this object:

@mcconkiee
mcconkiee / TimerView.m
Created March 31, 2014 21:30
font awesome as uilabel
//assumes FontAwesome.ttf is a resource and added to plist
NSInteger ti = (NSInteger)self.quizDuration ;
NSInteger seconds = ti % 60;
NSInteger minutes = (ti / 60) % 60;
NSInteger hours = (ti / 3600);
NSString *TTLE = [NSString stringWithFormat:@"%02li:%02li:%02li ", (long)hours, (long)minutes, (long)seconds];
//f01d = play
//f04c = pause
@mcconkiee
mcconkiee / application.html.erb
Created January 28, 2014 12:50
load page specific javascript
<% #place this in header %>
<% content_for :javascript_includes do %>
<%= javascript_include_tag "forms.js" %>
<% end %>
@mcconkiee
mcconkiee / new_gist_file.rb
Created December 11, 2013 00:02
creating a polymorphic relationship and form in rails
# Polymorphic Model
class Attachment < ActiveRecord::Base
belongs_to :attachable, :polymorphic => true
mount_uploader :image, ImageUploader
end
# Has Many Model
require 'carrierwave/orm/activerecord'
class Exercise < ActiveRecord::Base
has_many :images , :as=> :attachable, :dependent => :destroy ,:class_name => "Attachment"
@mcconkiee
mcconkiee / S3able intall and config.rb
Created December 5, 2013 16:08
S3able intall and config
#add to Gemfile
gem 's3able', path: '/Users/ericmcconkie/Desktop/s3uploadengine/s3able'
gem 'aws-sdk'
#mount to routes
mount S3able::Engine => '/images', :as => 's3image' #you can see all uploads at http://localhost:3000/images
get 'products/:id/image'=>'s3able/s3images#new', :s3imageable=>"Product" #a place to upload an image and attach to your model
#config
rake s3able:s3config secret="{{AWS_SECRET}}" key="{{AWS_KEY}}" bucket="{{aws_bucket}}"
@mcconkiee
mcconkiee / css_resources.md
Created December 1, 2013 16:28 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@mcconkiee
mcconkiee / javascript_resources.md
Created December 1, 2013 16:28 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@mcconkiee
mcconkiee / rails_resources.md
Created December 1, 2013 16:28 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h