Skip to content

Instantly share code, notes, and snippets.

View ryanjones's full-sized avatar

Ryan Jones ryanjones

View GitHub Profile
@ryanjones
ryanjones / git.sh
Created July 7, 2019 19:23
git aliases
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
@ryanjones
ryanjones / withAuthenticator.js
Last active March 26, 2019 01:52
React Native App.js with authenticator
import React from 'react';
import { Linking, Button, StyleSheet, Text, View } from 'react-native';
import Auth from '@aws-amplify/auth';
import Analytics from '@aws-amplify/analytics';
import { withAuthenticator } from 'aws-amplify-react-native';
import awsconfig from './aws-exports';
// retrieve temporary AWS credentials and sign requests
Auth.configure(awsconfig);
@ryanjones
ryanjones / cognito.yaml
Created October 29, 2018 01:34 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@ryanjones
ryanjones / gist:68ec194f015a2114fa01f86ef1e3e46a
Created August 25, 2018 03:01 — forked from mingderwang/gist:10963621
install s3cmd on mac os x
download tarball (http://s3tools.org/download)
$ sudo python setup.py install
$ s3cmd --configure
Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.
Access key and Secret key are your identifiers for Amazon S3
@ryanjones
ryanjones / math-quiz-crna.sh
Last active March 22, 2018 17:10
math-quiz
> create-react-native-app math-quiz
> cd math-quiz
> npm run eject
Select: React Native: I'd like a regular React Native project.
What should your app appear as on a user's home screen? math-quiz
What should your Android Studio and Xcode projects be called? mathquiz
> npm run ios
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('#membership-form').on('submit', function(e){
var member = $( "input:first" ).val();
e.preventDefault();
$.ajax({
method: "GET",
url: "https://api.ama.ab.ca/reward_dollars/promotions/3/contestants/"+ member +".jsonp",
jsonp: "callback",
@ryanjones
ryanjones / items_controller.rb
Last active August 29, 2015 14:10
Leverage decent exposure
# controller w/ decent exposure
class ItemsController < ApplicationController
expose(:item)
expose(:items)
def create
if item.save
redirect_to(item)
else
# Description:
# Automates aspects of mover.io's current Github workflow which leverages
# Github's issue tags and commenting system. We previously used a :+1:
# comment to approve pull requests, but doing so did not affect the state of
# the the PR.
#
# Included is a Github webhook handler that checks for comments containing
# certain trigger words. Currently:
#
# :+1: The pull request is approved.
@ryanjones
ryanjones / html_heroku
Last active August 29, 2015 13:57
Quick html site on heroku w/ rack
## run manually, currently not worth scripting.
## from https://devcenter.heroku.com/articles/static-sites-ruby
mkdir appname
mkdir -p site/public/{images,js,css}
touch site/{config.ru,public/index.html}
cd site && bundle init
echo -e "source :rubygems\ngem 'rack'" > Gemfile

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev