Skip to content

Instantly share code, notes, and snippets.

View chyld's full-sized avatar
:electron:
import numpy

Chyld Medford chyld

:electron:
import numpy
View GitHub Profile
class QuestionsController < ApplicationController
before_filter :ensure_logged_in
def index
end
def show
end
def new
@question = Question.new
end
def create
https://stripe.com/docs/button
https://stripe.com/docs/api
https://stripe.com/docs/button/guides/rails
bad card
4000 0000 0000 0002
good
4242 4242 4242 4242
init file
GOOGLEKEY='AIzaSyBYPC8Wothfroho8ub3yM6wHtOE--Oovng'
application.html.erb
<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{GOOGLEKEY}&sensor=false" %>
google.js
var map;
var canvas;
add gem omniauth-twitter
**********************************************************************************
initialization file:
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, ENV['TW_CON_KEY'], ENV['TW_CON_SEC']
end
@chyld
chyld / gist:4259690
Created December 11, 2012 16:03
capybara + rspec + launchy + database cleaner
group :development, :test do
gem 'pry-rails'
gem 'capybara'
gem 'rspec-rails'
gem 'launchy'
gem 'database_cleaner'
end
rails g rspec:install
@chyld
chyld / Gemfile
Last active October 14, 2015 00:38
source 'https://rubygems.org'
group :development do
gem 'annotate'
gem 'rails-footnotes'
gem 'localtunnel'
gem 'quiet_assets'
gem 'better_errors'
gem 'binding_of_caller'
end
@chyld
chyld / git
Last active February 18, 2024 23:43
git commands by use case
# updated 2017-07-16
https://github.com/nojhan/liquidprompt
# ----------------------------------------------------------------- #
REFERENCES
# ----------------------------------------------------------------- #
http://ndpsoftware.com/git-cheatsheet.html
# ----------------------------------------------------------------- #
@chyld
chyld / bash_profile
Last active December 11, 2015 18:09
txtblk='\[\e[0;30m\]' # Black
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
txtrst='\[\e[0m\]' # Text Reset
@chyld
chyld / branch.rb
Last active March 22, 2018 03:29
# encoding: utf-8
branches = STDIN.read.chomp
if !branches.empty?
branch = branches.split("\n").map(&:strip)[0].split(' ').map(&:strip)[-1]
second_line = branches.split("\n").map(&:strip)[1]
is_clean = second_line == "nothing to commit, working directory clean"
if !branches.empty?
if is_clean
puts " ✓ #{branch}"
else
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"highlight_line": true,
"highlight_modified_tabs": true,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"highlight_active_indent_guide": true,
"tab_size": 2,
"font_face": "Source Code Pro Light",
"font_size": 13,