Skip to content

Instantly share code, notes, and snippets.

@btwelch
btwelch / gist:7122135
Created October 23, 2013 16:43
How to give podcast reviews (in iTunes) from an iOS device.
(assuming ios)
Ok, for others with ios devices:
1) Install/Open the Apple Podcasts app
2) Click the "Store" button and search for your podcast
3) Click the podcast results in question
4) Click the "Reviews" tab button
5) Click the "Write a Review" button
Have at thee!
Hi there. You're here because you want to be a part of the podcast as a one-time or regular contributor.
We're happy to have you!
Many of you are abroad, and can never seem to make it to the 1pm EST Friday call. You still have an
opportunity to participate. Here's what you need to do:
1) Tell us ahead of time that you want to have your status in the next podcast.
Why? Because we go around the group and handoff to the next person, so we
want the moderator (which can be anyone) to say your name, and we'll splice
you in during POST
@btwelch
btwelch / gist:ec2cf4021cda1bd17223
Created January 23, 2015 16:15
Rails git-flow shell script for easy branching
#
# Usage:
#
# ./makesandwich.sh branch_name
#
#
# makesandwich.sh
#
echo "Changing to the home directory...";
@btwelch
btwelch / gist:422aac4dce4b9ae46323
Created January 24, 2015 16:20
Gem install specific version
gem install GEM_NAME -v SPECIFIC_VERSION
e: gem install autoprefixer-rails -v 5.0.0.1
@btwelch
btwelch / gist:49110630d4c5fadbfdde
Created January 24, 2015 17:49
Rails Pagination Example
# This is how it is done, even in Rails 4
gem 'will_paginate'
@stripe_events = StripeEvent.paginate(:page => params[:page], :per_page => 20)
<% will_paginate @stripe_events %>
@btwelch
btwelch / Component.jsx
Created June 26, 2018 16:27 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
<html>
<head>
<style type='text/css'>
body, html {
margin: 0;
padding: 0;
}
body {
color: black;
display: table;
@btwelch
btwelch / gist:d695e56457734e3c3b5de2eed73695a0
Created April 29, 2021 22:31
Hall Effect Tachometer - Rasberry Pi
import time, datetime, sys
import RPi.GPIO as GPIO
sense_pin = 7
LED_pin = 36
GPIO.setmode(GPIO.BOARD)
GPIO.setup(sense_pin, GPIO.IN)
GPIO.setmode(LED_pin, GPIO.OUT)
last_time = time.time()
application_controller.rb
...
private
def authenticate_user!
super
check_user_active!
end
module TrackedRetries
def with_tracked_retries(sync_record, max_attempts: 3)
attempts = 0
begin
attempts += 1
sync_record.update(attempts: attempts)
yield
sync_record.update(success: true)