Skip to content

Instantly share code, notes, and snippets.

View coderberry's full-sized avatar

Eric Berry coderberry

View GitHub Profile
@coderberry
coderberry / online-safety.md
Last active November 29, 2015 15:44
Protecting your Family from Pornography

Pornography Stats:

  • 12% of the websites on the internet are pornographic
  • 25% of all search engine requests are pornography related
  • 35% of all internet downloads are pornographic
  • Utah has the nations highest online porn subscription rate: 0.54%
  • The average age at which a child first sees porn online is 11 years old.

Educate your kids

  • Set guidelines for how your children uses the computer and discuss those guidelines with them.
  • Do not let your child give out personal information, such as address, phone number, or school name, online.
@coderberry
coderberry / lesson-21.md
Last active November 8, 2015 02:53
Links from Lesson 21 - Principles of Temporal and Spiritual Welfare
@coderberry
coderberry / effective_leader.md
Last active October 11, 2015 14:55
Notes from Lesson 19 of Ezra Taft Benson manual
  • Am I humble in leadership situations?
  • Do I lead by inspiration? Am I worthy of inspiration?
  • Am I a well informed leader and do I draw on knowledge of past experiences?
  • Do I have a firm understanding of the doctrines of the church?
  • Do I expect loyalty? Do I give it?
  • Do I take joy in the accomplishments of those I lead?
  • Do I publicly overrule decisions or privately converse with those whom I overrule first?
  • Do those I lead consider me as one of them? Am I united with my team?
  • Do I love those I work with?
  • Do I have faith in our youth?
@coderberry
coderberry / open_cloud66_backup.rb
Created September 23, 2015 18:59
Open the last database backup file in a browser to download
#!/usr/bin/env ruby
require 'typhoeus'
require 'json'
TOKEN = File.read("/path/to/.cloud66/token")
STACK_ID = 'MY_UNIQUE_STACK_ID_ON_CLOUD66'
# Get backups
request = Typhoeus::Request.new("https://app.cloud66.com/api/3/stacks/#{STACK_ID}/backups.json", method: :get, headers: { Authorization: "Bearer #{TOKEN}" })
@coderberry
coderberry / cloud66_status.rb
Created September 23, 2015 18:53
Check deployment status of a Cloud66 stack
#!/usr/bin/env ruby
require 'typhoeus'
require 'json'
STATUSES = {
0 => 'Pending',
1 => 'Deployed',
2 => 'Deployment failed',
3 => 'Analyzing',
#!/usr/bin/env ruby
require 'typhoeus'
require 'json'
NAME = 'MY_APP_NAME'
TOKEN = File.read("~/.cloud66/token")
STACK_ID = 'MY_CLOUD66_STACK_ID'
# Get backups
@coderberry
coderberry / EmojiDetailInterfaceController.swift
Created July 9, 2015 19:43
Example of using a switch statement instead of if/else statements
//
// EmojiDetailInterfaceController.swift
// Emojis
//
// Created by Eric Berry on 7/9/15.
// Copyright (c) 2015 Eric Berry. All rights reserved.
//
import WatchKit
import Foundation
@coderberry
coderberry / cloud66_status.rb
Last active August 29, 2015 14:24
Get deploy status for Cloud66 in your terminal
require 'typhoeus'
require 'json'
STATUSES = {
0 => 'Pending',
1 => 'Deployed',
2 => 'Deployment failed',
3 => 'Analyzing',
4 => 'Analyzed',
5 => 'Queued for deployment',
@coderberry
coderberry / locations.rb
Created June 25, 2015 18:34
US States with Google Adwords Location ID
US_STATES = {
'AK' => { name: 'Alaska', location_id: 21132 },
'AL' => { name: 'Alabama', location_id: 21133 },
'AR' => { name: 'Arkansas', location_id: 21135 },
'AS' => { name: 'American Samoa', location_id: 2016 },
'AZ' => { name: 'Arizona', location_id: 21136 },
'CA' => { name: 'California', location_id: 21137 },
'CO' => { name: 'Colorado', location_id: 21138 },
'CT' => { name: 'Connecticut', location_id: 21139 },
'DC' => { name: 'District of Columbia', location_id: 21140 },
/** @jsx React.DOM */
var React = require('react')
, mui = require('material-ui')
, { TextField } = mui
, $ = require('jquery');
require('jquery.inputmask');
var MaskedTextField = React.createClass({